diff options
author | Evgeny Zuev <evgeny.zuev@xored.com> | 2017-09-05 12:19:15 +0700 |
---|---|---|
committer | Evgeny Zuev <evgeny.zuev@xored.com> | 2017-09-05 12:19:15 +0700 |
commit | 094237eca067cc6710b06c03a46b109f7acc58b1 (patch) | |
tree | 5cbc53da6f2e00b3c9d870d047ed0436dceaafc1 /drivers | |
parent | e611ff5f0110210221a6f90250bdd65f5fb3ff2d (diff) |
Fix unshaded materials render
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 690709e585..f60d00ffba 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -2300,15 +2300,12 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G //e->light_type=0xFF; // no lights! - if (p_depth_pass) { - if (p_material->shader->spatial.unshaded || state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_UNSHADED) { - - e->sort_key |= SORT_KEY_UNSHADED_FLAG; - } + if (p_depth_pass || p_material->shader->spatial.unshaded || state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_UNSHADED) { + e->sort_key |= SORT_KEY_UNSHADED_FLAG; + } - if (p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { - e->sort_key |= RenderList::SORT_KEY_OPAQUE_PRE_PASS; - } + if (p_depth_pass && p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { + e->sort_key |= RenderList::SORT_KEY_OPAQUE_PRE_PASS; } if (!p_depth_pass && (p_material->shader->spatial.uses_vertex_lighting || storage->config.force_vertex_shading)) { |