summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-08-25 09:53:20 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-08-25 09:56:10 -0300
commit90445aae67159adafbcbb5a0027d1e793d6ea7ef (patch)
treee4ce7d686b34500c35d83cc3c35d0f5705e2447c
parent490aef93699abc00da58f73b1596fb3473fd53c6 (diff)
Fixed opaque unshaded materials, they go through the regular opaque render list, closes #9917
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp2
-rw-r--r--drivers/gles3/shaders/scene.glsl10
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 05cfba726c..1035e9293a 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -2194,7 +2194,7 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, RasterizerStorageGLES3::Material *p_material, bool p_shadow) {
- bool has_base_alpha = (p_material->shader->spatial.uses_alpha && !p_material->shader->spatial.uses_alpha_scissor) || p_material->shader->spatial.uses_screen_texture || p_material->shader->spatial.unshaded;
+ bool has_base_alpha = (p_material->shader->spatial.uses_alpha && !p_material->shader->spatial.uses_alpha_scissor) || p_material->shader->spatial.uses_screen_texture;
bool has_blend_alpha = p_material->shader->spatial.blend_mode != RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX || p_material->shader->spatial.ontop;
bool has_alpha = has_base_alpha || has_blend_alpha;
bool shadow = false;
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index e6476bd6b6..c9e9dacdb5 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1969,6 +1969,14 @@ FRAGMENT_SHADER_CODE
#ifdef USE_MULTIPLE_RENDER_TARGETS
+
+#ifdef SHADELESS
+ frag_color=vec4(albedo,alpha);
+ diffuse_buffer=vec4(albedo.rgb,0.0);
+ specular_buffer=vec4(0.0);
+
+#else
+
#if defined(ENABLE_AO)
float ambient_scale=0.0; // AO is supplied by material
@@ -1984,6 +1992,7 @@ FRAGMENT_SHADER_CODE
diffuse_buffer=vec4(emission+diffuse_light+ambient_light,ambient_scale);
specular_buffer=vec4(specular_light,metallic);
+#endif //SHADELESS
normal_mr_buffer=vec4(normalize(normal)*0.5+0.5,roughness);
@@ -1991,6 +2000,7 @@ FRAGMENT_SHADER_CODE
sss_buffer = sss_strength;
#endif
+
#else //USE_MULTIPLE_RENDER_TARGETS