diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-07-05 19:36:56 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-07-05 19:39:45 -0300 |
commit | 12a8fedfe604c7b944030ba772093ac0e2a85c78 (patch) | |
tree | 4d4611324630b6e8872b9aad4ab70da976e71f81 /drivers/gles2 | |
parent | 58320b7f6cfe17ad3793a9ce6981b8ce0e50ad6a (diff) |
Some changes to dual paraboloid envmap generation, fixes somme bleeding
Diffstat (limited to 'drivers/gles2')
-rw-r--r-- | drivers/gles2/shaders/copy.glsl | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/gles2/shaders/copy.glsl b/drivers/gles2/shaders/copy.glsl index cb42970921..3f060cb97f 100644 --- a/drivers/gles2/shaders/copy.glsl +++ b/drivers/gles2/shaders/copy.glsl @@ -16,6 +16,7 @@ attribute vec2 uv_in; // attrib:4 #endif attribute vec2 uv2_in; // attrib:5 + #ifdef USE_CUBEMAP varying vec3 cube_interp; #else @@ -58,7 +59,9 @@ float sRGB_gamma_correct(float c){ #define LUM_RANGE 4.0 -#ifdef USE_CUBEMAP +#ifdef USE_ARRAY +uniform sampler2DArray source; +#elif defined(USE_CUBEMAP) varying vec3 cube_interp; uniform samplerCube source_cube; #else @@ -145,23 +148,17 @@ uniform float custom_alpha; void main() { //vec4 color = color_interp; -#ifdef USE_HIGHP_SOURCE -#ifdef USE_CUBEMAP + +#ifdef USE_ARRAY + highp vec4 color = textureLod( source, vec3(uv_interp,0.0),0.0 ); +#elif defined(USE_CUBEMAP) highp vec4 color = textureCube( source_cube, normalize(cube_interp) ); #else highp vec4 color = texture2D( source, uv_interp ); #endif -#else - -#ifdef USE_CUBEMAP - vec4 color = textureCube( source_cube, normalize(cube_interp) ); - -#else - vec4 color = texture2D( source, uv_interp ); -#endif #endif |