You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
add 3D textures
This commit is contained in:
@@ -90,11 +90,17 @@ public:
|
||||
TEXTURE_FLAG_ANISOTROPIC_FILTER = 8,
|
||||
TEXTURE_FLAG_CONVERT_TO_LINEAR = 16,
|
||||
TEXTURE_FLAG_MIRRORED_REPEAT = 32, /// Repeat texture, with alternate sections mirrored
|
||||
TEXTURE_FLAG_CUBEMAP = 2048,
|
||||
TEXTURE_FLAG_USED_FOR_STREAMING = 4096,
|
||||
TEXTURE_FLAG_USED_FOR_STREAMING = 2048,
|
||||
TEXTURE_FLAGS_DEFAULT = TEXTURE_FLAG_REPEAT | TEXTURE_FLAG_MIPMAPS | TEXTURE_FLAG_FILTER
|
||||
};
|
||||
|
||||
enum TextureType {
|
||||
TEXTURE_TYPE_2D,
|
||||
TEXTURE_TYPE_CUBEMAP,
|
||||
TEXTURE_TYPE_2D_ARRAY,
|
||||
TEXTURE_TYPE_3D,
|
||||
};
|
||||
|
||||
enum CubeMapSide {
|
||||
|
||||
CUBEMAP_LEFT,
|
||||
@@ -107,17 +113,33 @@ public:
|
||||
|
||||
virtual RID texture_create() = 0;
|
||||
RID texture_create_from_image(const Ref<Image> &p_image, uint32_t p_flags = TEXTURE_FLAGS_DEFAULT); // helper
|
||||
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = TEXTURE_FLAGS_DEFAULT) = 0;
|
||||
virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, CubeMapSide p_cube_side = CUBEMAP_LEFT) = 0;
|
||||
virtual void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, CubeMapSide p_cube_side = CUBEMAP_LEFT) = 0;
|
||||
virtual Ref<Image> texture_get_data(RID p_texture, CubeMapSide p_cube_side = CUBEMAP_LEFT) const = 0;
|
||||
virtual void texture_allocate(RID p_texture,
|
||||
int p_width,
|
||||
int p_height,
|
||||
int p_depth_3d,
|
||||
Image::Format p_format,
|
||||
TextureType p_type,
|
||||
uint32_t p_flags = TEXTURE_FLAGS_DEFAULT) = 0;
|
||||
|
||||
virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) = 0;
|
||||
virtual void texture_set_data_partial(RID p_texture,
|
||||
const Ref<Image> &p_image,
|
||||
int src_x, int src_y,
|
||||
int src_w, int src_h,
|
||||
int dst_x, int dst_y,
|
||||
int p_dst_mip,
|
||||
int p_layer = 0) = 0;
|
||||
|
||||
virtual Ref<Image> texture_get_data(RID p_texture, int p_layer = 0) const = 0;
|
||||
virtual void texture_set_flags(RID p_texture, uint32_t p_flags) = 0;
|
||||
virtual uint32_t texture_get_flags(RID p_texture) const = 0;
|
||||
virtual Image::Format texture_get_format(RID p_texture) const = 0;
|
||||
virtual TextureType texture_get_type(RID p_texture) const = 0;
|
||||
virtual uint32_t texture_get_texid(RID p_texture) const = 0;
|
||||
virtual uint32_t texture_get_width(RID p_texture) const = 0;
|
||||
virtual uint32_t texture_get_height(RID p_texture) const = 0;
|
||||
virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) = 0;
|
||||
virtual uint32_t texture_get_depth(RID p_texture) const = 0;
|
||||
virtual void texture_set_size_override(RID p_texture, int p_width, int p_height, int p_depth_3d) = 0;
|
||||
|
||||
virtual void texture_set_path(RID p_texture, const String &p_path) = 0;
|
||||
virtual String texture_get_path(RID p_texture) const = 0;
|
||||
@@ -132,7 +154,9 @@ public:
|
||||
|
||||
struct TextureInfo {
|
||||
RID texture;
|
||||
Size2 size;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t depth;
|
||||
Image::Format format;
|
||||
int bytes;
|
||||
String path;
|
||||
@@ -1054,6 +1078,7 @@ VARIANT_ENUM_CAST(VisualServer::EnvironmentSSAOQuality);
|
||||
VARIANT_ENUM_CAST(VisualServer::EnvironmentSSAOBlur);
|
||||
VARIANT_ENUM_CAST(VisualServer::InstanceFlags);
|
||||
VARIANT_ENUM_CAST(VisualServer::ShadowCastingSetting);
|
||||
VARIANT_ENUM_CAST(VisualServer::TextureType);
|
||||
|
||||
//typedef VisualServer VS; // makes it easier to use
|
||||
#define VS VisualServer
|
||||
|
||||
Reference in New Issue
Block a user