From 0f817e127d07aa44cbb7cfbca89a8698a06e5d7d Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sun, 8 Aug 2021 19:26:00 +0300 Subject: [PATCH] [3.x] Fix a default shader specular render mode to (SCHLICK_GGX) --- drivers/gles2/shaders/scene.glsl | 5 +++++ drivers/gles3/shaders/scene.glsl | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index 12a6bbb55ace..e8310d9aab6d 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -1278,6 +1278,11 @@ LIGHT_SHADER_CODE float NdotV = dot(N, V); float cNdotV = max(abs(NdotV), 1e-6); +/* Make a default specular mode SPECULAR_SCHLICK_GGX. */ +#if !defined(SPECULAR_DISABLED) && !defined(SPECULAR_SCHLICK_GGX) && !defined(SPECULAR_BLINN) && !defined(SPECULAR_PHONG) && !defined(SPECULAR_TOON) +#define SPECULAR_SCHLICK_GGX +#endif + #if defined(DIFFUSE_BURLEY) || defined(SPECULAR_BLINN) || defined(SPECULAR_SCHLICK_GGX) || defined(LIGHT_USE_CLEARCOAT) vec3 H = normalize(V + L); #endif diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 8de8b478b7da..5aa1f47f30ba 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1036,6 +1036,11 @@ LIGHT_SHADER_CODE float NdotV = dot(N, V); float cNdotV = max(NdotV, 0.0); +/* Make a default specular mode SPECULAR_SCHLICK_GGX. */ +#if !defined(SPECULAR_DISABLED) && !defined(SPECULAR_SCHLICK_GGX) && !defined(SPECULAR_BLINN) && !defined(SPECULAR_PHONG) && !defined(SPECULAR_TOON) +#define SPECULAR_SCHLICK_GGX +#endif + #if defined(DIFFUSE_BURLEY) || defined(SPECULAR_BLINN) || defined(SPECULAR_SCHLICK_GGX) || defined(LIGHT_USE_CLEARCOAT) vec3 H = normalize(V + L); #endif