Texture refactor
-Texture renamed to Texture2D -TextureLayered as base now inherits 2Darray, cubemap and cubemap array -Removed all references to flags in textures (they will go in the shader) -Texture3D gone for now (will come back later done properly) -Create base rasterizer for RenderDevice, RasterizerRD
This commit is contained in:
parent
9ffe57a10e
commit
3f335ce3d4
287 changed files with 2829 additions and 2540 deletions
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include "core/image.h"
|
||||
#include "core/io/resource_importer.h"
|
||||
|
||||
#include "servers/visual_server.h"
|
||||
class StreamTexture;
|
||||
|
||||
class ResourceImporterTexture : public ResourceImporter {
|
||||
|
|
@ -42,14 +42,25 @@ class ResourceImporterTexture : public ResourceImporter {
|
|||
protected:
|
||||
enum {
|
||||
MAKE_3D_FLAG = 1,
|
||||
MAKE_SRGB_FLAG = 2,
|
||||
MAKE_ROUGHNESS_FLAG = 2,
|
||||
MAKE_NORMAL_FLAG = 4
|
||||
};
|
||||
|
||||
Mutex *mutex;
|
||||
Map<StringName, int> make_flags;
|
||||
struct MakeInfo {
|
||||
|
||||
static void _texture_reimport_srgb(const Ref<StreamTexture> &p_tex);
|
||||
int flags;
|
||||
String normal_path_for_roughness;
|
||||
VS::TextureDetectRoughnessChannel channel_for_roughness;
|
||||
MakeInfo() {
|
||||
flags = 0;
|
||||
channel_for_roughness = VS::TEXTURE_DETECT_ROUGNHESS_R;
|
||||
}
|
||||
};
|
||||
|
||||
Map<StringName, MakeInfo> make_flags;
|
||||
|
||||
static void _texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, VisualServer::TextureDetectRoughnessChannel p_channel);
|
||||
static void _texture_reimport_3d(const Ref<StreamTexture> &p_tex);
|
||||
static void _texture_reimport_normal(const Ref<StreamTexture> &p_tex);
|
||||
|
||||
|
|
@ -84,7 +95,7 @@ public:
|
|||
virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const;
|
||||
virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
|
||||
|
||||
void _save_stex(const Ref<Image> &p_image, const String &p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable, bool p_detect_3d, bool p_detect_srgb, bool p_force_rgbe, bool p_detect_normal, bool p_force_normal, bool p_force_po2_for_compressed);
|
||||
void _save_stex(const Ref<Image> &p_image, const String &p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, bool p_streamable, bool p_detect_3d, bool p_detect_srgb, bool p_force_rgbe, bool p_detect_normal, bool p_force_normal, bool p_srgb_friendly, bool p_force_po2_for_compressed);
|
||||
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue