diff options
author | Juan Linietsky <juan@godotengine.org> | 2017-12-26 11:09:52 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2017-12-26 11:09:52 -0300 |
commit | 2b31155baa48788327c927007decc4621a6bf19a (patch) | |
tree | 88cfcf29a39b06c6e5b72770d89150be0ee0e73c /drivers/gles3 | |
parent | 4a2eef4ad801a3dc5c07a575e59b8f1eafa42c6e (diff) |
Fix sidedness check in material. Also remove SIDE built-in.
Diffstat (limited to 'drivers/gles3')
-rw-r--r-- | drivers/gles3/shader_compiler_gles3.cpp | 3 | ||||
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 101978548d..ec00c057b2 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -806,7 +806,6 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"] = "screen_uv"; actions[VS::SHADER_SPATIAL].renames["SCREEN_TEXTURE"] = "screen_texture"; actions[VS::SHADER_SPATIAL].renames["DEPTH_TEXTURE"] = "depth_buffer"; - actions[VS::SHADER_SPATIAL].renames["SIDE"] = "side"; actions[VS::SHADER_SPATIAL].renames["ALPHA_SCISSOR"] = "alpha_scissor"; //for light @@ -847,6 +846,8 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["world_vertex_coords"] = "#define VERTEX_WORLD_COORDS_USED\n"; + actions[VS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n"; + actions[VS::SHADER_SPATIAL].render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_oren_nayar"] = "#define DIFFUSE_OREN_NAYAR\n"; diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index bb9ff29a8e..9f3f9ced02 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1615,7 +1615,7 @@ void main() { float alpha = 1.0; -#ifdef METERIAL_DOUBLESIDED +#if defined(DO_SIDE_CHECK) float side=float(gl_FrontFacing)*2.0-1.0; #else float side=1.0; |