32 #include "servers/visual_server.h" 33 #include "scene/resources/texture.h" 34 #include "scene/resources/shader.h" 36 #include "servers/visual/shader_language.h" 45 RES_BASE_EXTENSION(
"mtl");
51 FLAG_VISIBLE = VS::MATERIAL_FLAG_VISIBLE,
52 FLAG_DOUBLE_SIDED = VS::MATERIAL_FLAG_DOUBLE_SIDED,
53 FLAG_INVERT_FACES = VS::MATERIAL_FLAG_INVERT_FACES,
54 FLAG_UNSHADED = VS::MATERIAL_FLAG_UNSHADED,
55 FLAG_ONTOP = VS::MATERIAL_FLAG_ONTOP,
56 FLAG_LIGHTMAP_ON_UV2 = VS::MATERIAL_FLAG_LIGHTMAP_ON_UV2,
57 FLAG_COLOR_ARRAY_SRGB = VS::MATERIAL_FLAG_COLOR_ARRAY_SRGB,
58 FLAG_MAX = VS::MATERIAL_FLAG_MAX
62 BLEND_MODE_MIX = VS::MATERIAL_BLEND_MODE_MIX,
63 BLEND_MODE_MUL = VS::MATERIAL_BLEND_MODE_MUL,
64 BLEND_MODE_ADD = VS::MATERIAL_BLEND_MODE_ADD,
65 BLEND_MODE_SUB = VS::MATERIAL_BLEND_MODE_SUB,
66 BLEND_MODE_PREMULT_ALPHA = VS::MATERIAL_BLEND_MODE_PREMULT_ALPHA,
71 DEPTH_DRAW_ALWAYS = VS::MATERIAL_DEPTH_DRAW_ALWAYS,
72 DEPTH_DRAW_OPAQUE_ONLY = VS::MATERIAL_DEPTH_DRAW_OPAQUE_ONLY,
73 DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA = VS::MATERIAL_DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA,
74 DEPTH_DRAW_NEVER = VS::MATERIAL_DEPTH_DRAW_NEVER
81 bool flags[VS::MATERIAL_FLAG_MAX];
83 DepthDrawMode depth_draw_mode;
87 static void _bind_methods();
90 void set_flag(Flag p_flag,
bool p_enabled);
91 bool get_flag(Flag p_flag)
const;
93 void set_blend_mode(BlendMode p_blend_mode);
94 BlendMode get_blend_mode()
const;
96 void set_depth_draw_mode(DepthDrawMode p_depth_draw_mode);
97 DepthDrawMode get_depth_draw_mode()
const;
99 void set_line_width(
float p_width);
100 float get_line_width()
const;
102 virtual RID get_rid()
const;
108 VARIANT_ENUM_CAST( Material::Flag );
109 VARIANT_ENUM_CAST( Material::DepthDrawMode );
111 VARIANT_ENUM_CAST( Material::BlendMode );
117 REVERSE_GET_PROPERTY_LIST
121 PARAM_DIFFUSE=VS::FIXED_MATERIAL_PARAM_DIFFUSE,
122 PARAM_DETAIL=VS::FIXED_MATERIAL_PARAM_DETAIL,
123 PARAM_SPECULAR=VS::FIXED_MATERIAL_PARAM_SPECULAR,
124 PARAM_EMISSION=VS::FIXED_MATERIAL_PARAM_EMISSION,
125 PARAM_SPECULAR_EXP=VS::FIXED_MATERIAL_PARAM_SPECULAR_EXP,
126 PARAM_GLOW=VS::FIXED_MATERIAL_PARAM_GLOW,
127 PARAM_NORMAL=VS::FIXED_MATERIAL_PARAM_NORMAL,
128 PARAM_SHADE_PARAM=VS::FIXED_MATERIAL_PARAM_SHADE_PARAM,
129 PARAM_MAX=VS::FIXED_MATERIAL_PARAM_MAX
135 TEXCOORD_UV=VS::FIXED_MATERIAL_TEXCOORD_UV,
136 TEXCOORD_UV_TRANSFORM=VS::FIXED_MATERIAL_TEXCOORD_UV_TRANSFORM,
137 TEXCOORD_UV2=VS::FIXED_MATERIAL_TEXCOORD_UV2,
138 TEXCOORD_SPHERE=VS::FIXED_MATERIAL_TEXCOORD_SPHERE
142 FLAG_USE_ALPHA=VS::FIXED_MATERIAL_FLAG_USE_ALPHA,
143 FLAG_USE_COLOR_ARRAY=VS::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,
144 FLAG_USE_POINT_SIZE=VS::FIXED_MATERIAL_FLAG_USE_POINT_SIZE,
145 FLAG_DISCARD_ALPHA=VS::FIXED_MATERIAL_FLAG_DISCARD_ALPHA,
146 FLAG_USE_XY_NORMALMAP=VS::FIXED_MATERIAL_FLAG_USE_XY_NORMALMAP,
147 FLAG_MAX=VS::FIXED_MATERIAL_FLAG_MAX
152 LIGHT_SHADER_LAMBERT=VS::FIXED_MATERIAL_LIGHT_SHADER_LAMBERT,
153 LIGHT_SHADER_WRAP=VS::FIXED_MATERIAL_LIGHT_SHADER_WRAP,
154 LIGHT_SHADER_VELVET=VS::FIXED_MATERIAL_LIGHT_SHADER_VELVET,
155 LIGHT_SHADER_TOON=VS::FIXED_MATERIAL_LIGHT_SHADER_TOON
170 TexCoordMode texture_texcoord[PARAM_MAX];
171 LightShader light_shader;
172 bool fixed_flags[FLAG_MAX];
181 static void _bind_methods();
186 void set_fixed_flag(FixedFlag p_flag,
bool p_value);
187 bool get_fixed_flag(FixedFlag p_flag)
const;
189 void set_parameter(Parameter p_parameter,
const Variant& p_value);
190 Variant get_parameter(Parameter p_parameter)
const;
192 void set_texture(Parameter p_parameter,
Ref<Texture> p_texture);
195 void set_texcoord_mode(Parameter p_parameter, TexCoordMode p_mode);
196 TexCoordMode get_texcoord_mode(Parameter p_parameter)
const;
198 void set_light_shader(LightShader p_shader);
199 LightShader get_light_shader()
const;
201 void set_uv_transform(
const Transform& p_transform);
204 void set_point_size(
float p_transform);
205 float get_point_size()
const;
214 VARIANT_ENUM_CAST( FixedMaterial::Parameter );
215 VARIANT_ENUM_CAST( FixedMaterial::TexCoordMode );
216 VARIANT_ENUM_CAST( FixedMaterial::FixedFlag );
217 VARIANT_ENUM_CAST( FixedMaterial::LightShader );
227 void _shader_changed();
228 static void _shader_parse(
void*p_self,ShaderLanguage::ProgramNode*p_node);
236 static void _bind_methods();
Definition: string_db.h:48
Definition: material.h:219
Definition: resource.h:89
Definition: material.h:42
Definition: material.h:114