From ea6ed9658dec58b22b594d041800e87d891411fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Sun, 7 Aug 2022 23:11:44 +0200 Subject: [PATCH] Fix emission not working in the ubershader --- drivers/gles3/shaders/scene.glsl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 15491911dcb..a45a363c5ad 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -2376,9 +2376,9 @@ FRAGMENT_SHADER_CODE float max_ambient = max(ambient_light.r, max(ambient_light.g, ambient_light.b)); float max_diffuse = max(diffuse_light.r, max(diffuse_light.g, diffuse_light.b)); float total_ambient = max_ambient + max_diffuse; -#ifdef USE_FORWARD_LIGHTING +#ifdef USE_FORWARD_LIGHTING //ubershader-runtime total_ambient += max_emission; -#endif +#endif //ubershader-runtime float ambient_scale = (total_ambient > 0.0) ? (max_ambient + ambient_occlusion_affect_light * max_diffuse) / total_ambient : 0.0; #if defined(ENABLE_AO) @@ -2387,9 +2387,9 @@ FRAGMENT_SHADER_CODE diffuse_buffer = vec4(diffuse_light + ambient_light, ambient_scale); specular_buffer = vec4(specular_light, metallic); -#ifdef USE_FORWARD_LIGHTING +#ifdef USE_FORWARD_LIGHTING //ubershader-runtime diffuse_buffer.rgb += emission; -#endif +#endif //ubershader-runtime #endif //SHADELESS //ubershader-runtime normal_mr_buffer = vec4(normalize(normal) * 0.5 + 0.5, roughness); @@ -2404,9 +2404,9 @@ FRAGMENT_SHADER_CODE frag_color = vec4(albedo, alpha); #else //ubershader-runtime frag_color = vec4(ambient_light + diffuse_light + specular_light, alpha); -#ifdef USE_FORWARD_LIGHTING +#ifdef USE_FORWARD_LIGHTING //ubershader-runtime frag_color.rgb += emission; -#endif +#endif //ubershader-runtime #endif //SHADELESS //ubershader-runtime #endif //USE_MULTIPLE_RENDER_TARGETS //ubershader-runtime