summaryrefslogtreecommitdiff
path: root/scene/resources/material.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/material.h')
-rw-r--r--scene/resources/material.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 6a0eead708..4e77ab1ed6 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -48,15 +48,23 @@ class Material : public Resource {
RID material;
Ref<Material> next_pass;
+ int render_priority;
protected:
_FORCE_INLINE_ RID _get_material() const { return material; }
static void _bind_methods();
public:
+ enum {
+ RENDER_PRIORITY_MAX = VS::MATERIAL_RENDER_PRIORITY_MAX,
+ RENDER_PRIORITY_MIN = VS::MATERIAL_RENDER_PRIORITY_MIN,
+ };
void set_next_pass(const Ref<Material> &p_pass);
Ref<Material> get_next_pass() const;
+ void set_render_priority(int p_priority);
+ int get_render_priority() const;
+
virtual RID get_rid() const;
Material();
virtual ~Material();
@@ -104,6 +112,7 @@ public:
TEXTURE_AMBIENT_OCCLUSION,
TEXTURE_DEPTH,
TEXTURE_SUBSURFACE_SCATTERING,
+ TEXTURE_TRANSMISSION,
TEXTURE_REFRACTION,
TEXTURE_DETAIL_MASK,
TEXTURE_DETAIL_ALBEDO,
@@ -127,6 +136,7 @@ public:
FEATURE_AMBIENT_OCCLUSION,
FEATURE_DEPTH_MAPPING,
FEATURE_SUBSURACE_SCATTERING,
+ FEATURE_TRANSMISSION,
FEATURE_REFRACTION,
FEATURE_DETAIL,
FEATURE_MAX
@@ -156,13 +166,14 @@ public:
enum Flags {
FLAG_UNSHADED,
FLAG_USE_VERTEX_LIGHTING,
- FLAG_ONTOP,
+ FLAG_DISABLE_DEPTH_TEST,
FLAG_ALBEDO_FROM_VERTEX_COLOR,
FLAG_SRGB_VERTEX_COLOR,
FLAG_USE_POINT_SIZE,
FLAG_FIXED_SIZE,
FLAG_UV1_USE_TRIPLANAR,
FLAG_UV2_USE_TRIPLANAR,
+ FLAG_TRIPLANAR_USE_WORLD,
FLAG_AO_ON_UV2,
FLAG_USE_ALPHA_SCISSOR,
FLAG_MAX
@@ -170,7 +181,7 @@ public:
enum DiffuseMode {
DIFFUSE_LAMBERT,
- DIFFUSE_HALF_LAMBERT,
+ DIFFUSE_LAMBERT_WRAP,
DIFFUSE_OREN_NAYAR,
DIFFUSE_BURLEY,
DIFFUSE_TOON,
@@ -203,12 +214,12 @@ private:
union MaterialKey {
struct {
- uint64_t feature_mask : 11;
+ uint64_t feature_mask : 12;
uint64_t detail_uv : 1;
uint64_t blend_mode : 2;
uint64_t depth_draw_mode : 2;
uint64_t cull_mode : 2;
- uint64_t flags : 11;
+ uint64_t flags : 12;
uint64_t detail_blend_mode : 2;
uint64_t diffuse_mode : 3;
uint64_t specular_mode : 2;
@@ -277,6 +288,7 @@ private:
StringName anisotropy;
StringName depth_scale;
StringName subsurface_scattering_strength;
+ StringName transmission;
StringName refraction;
StringName point_size;
StringName uv1_scale;
@@ -328,6 +340,7 @@ private:
float anisotropy;
float depth_scale;
float subsurface_scattering_strength;
+ Color transmission;
float refraction;
float line_width;
float point_size;
@@ -434,6 +447,9 @@ public:
void set_subsurface_scattering_strength(float p_subsurface_scattering_strength);
float get_subsurface_scattering_strength() const;
+ void set_transmission(const Color &p_transmission);
+ Color get_transmission() const;
+
void set_refraction(float p_refraction);
float get_refraction() const;
@@ -511,6 +527,8 @@ public:
void set_alpha_scissor_threshold(float p_treshold);
float get_alpha_scissor_threshold() const;
+ void set_on_top_of_alpha();
+
void set_metallic_texture_channel(TextureChannel p_channel);
TextureChannel get_metallic_texture_channel() const;
void set_roughness_texture_channel(TextureChannel p_channel);