summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-19 18:55:51 +0100
committerGitHub <noreply@github.com>2020-01-19 18:55:51 +0100
commit90a224c6eb202c1e6d87bded6adf50d7e40f08fc (patch)
tree26a7f3aa49c43d536b4721eda5c385061c4c3cc2 /drivers/gles3/shaders
parentbaa7d49c3a7054330fb5fa80905ce90885b00d32 (diff)
parentdc4db4ab4568c217385146b5874bdf994c5f3006 (diff)
Merge pull request #35310 from akien-mga/gles3-irradiance-small-optimization
GLES3: Slight optimization to irradiance compute
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r--drivers/gles3/shaders/cubemap_filter.glsl6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gles3/shaders/cubemap_filter.glsl b/drivers/gles3/shaders/cubemap_filter.glsl
index 15d4e2d58e..e1872eb433 100644
--- a/drivers/gles3/shaders/cubemap_filter.glsl
+++ b/drivers/gles3/shaders/cubemap_filter.glsl
@@ -23,6 +23,7 @@ precision highp int;
#ifdef USE_SOURCE_PANORAMA
uniform sampler2D source_panorama; //texunit:0
+uniform float source_resolution;
#endif
#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
@@ -44,7 +45,6 @@ uniform samplerCube source_cube; //texunit:0
uniform int face_id;
uniform float roughness;
-uniform float source_resolution;
in highp vec2 uv_interp;
@@ -332,6 +332,7 @@ void main() {
if (ndotl > 0.0) {
+#ifdef USE_SOURCE_PANORAMA
float D = DistributionGGX(N, H, roughness);
float ndoth = max(dot(N, H), 0.0);
float hdotv = max(dot(H, V), 0.0);
@@ -342,17 +343,14 @@ void main() {
float mipLevel = roughness == 0.0 ? 0.0 : 0.5 * log2(saSample / saTexel);
-#ifdef USE_SOURCE_PANORAMA
sum.rgb += texturePanorama(L, source_panorama, mipLevel).rgb * ndotl;
#endif
#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
-
sum.rgb += textureDualParaboloidArray(L).rgb * ndotl;
#endif
#ifdef USE_SOURCE_DUAL_PARABOLOID
-
sum.rgb += textureDualParaboloid(L).rgb * ndotl;
#endif