
==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 129 (native 129) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 127 LINK FAILED ========
-------- shader 128 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 129 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 57 (native 57) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 55 LINK FAILED ========
-------- shader 56 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 57 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 54 (native 54) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 52 LINK FAILED ========
-------- shader 53 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 54 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 57 (native 57) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 55 LINK FAILED ========
-------- shader 56 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 57 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 84 (native 84) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 82 LINK FAILED ========
-------- shader 83 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 84 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 84 (native 84) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 82 LINK FAILED ========
-------- shader 83 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 84 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 93 (native 93) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 91 LINK FAILED ========
-------- shader 92 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 93 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 99 (native 99) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 97 LINK FAILED ========
-------- shader 98 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 99 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 84 (native 84) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 82 LINK FAILED ========
-------- shader 83 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 84 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 99 (native 99) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 97 LINK FAILED ========
-------- shader 98 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 99 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 102 (native 102) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 100 LINK FAILED ========
-------- shader 101 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 102 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 105 (native 105) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 103 LINK FAILED ========
-------- shader 104 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 105 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 102 (native 102) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 100 LINK FAILED ========
-------- shader 101 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 102 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 102 (native 102) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 100 LINK FAILED ========
-------- shader 101 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 102 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 99 (native 99) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 97 LINK FAILED ========
-------- shader 98 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 99 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 93 (native 93) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 91 LINK FAILED ========
-------- shader 92 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 93 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 90 (native 90) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 88 LINK FAILED ========
-------- shader 89 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 90 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 141 (native 141) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 139 LINK FAILED ========
-------- shader 140 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 141 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 90 (native 90) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 88 LINK FAILED ========
-------- shader 89 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 90 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 78 (native 78) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 76 LINK FAILED ========
-------- shader 77 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 78 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 84 (native 84) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 82 LINK FAILED ========
-------- shader 83 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 84 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 84 (native 84) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 82 LINK FAILED ========
-------- shader 83 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 84 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 78 (native 78) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 76 LINK FAILED ========
-------- shader 77 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 78 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 78 (native 78) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 76 LINK FAILED ========
-------- shader 77 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 78 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 69 (native 69) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 67 LINK FAILED ========
-------- shader 68 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 69 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 66 (native 66) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 64 LINK FAILED ========
-------- shader 65 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 66 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 60 (native 60) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 58 LINK FAILED ========
-------- shader 59 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 60 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 69 (native 69) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 67 LINK FAILED ========
-------- shader 68 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 69 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 66 (native 66) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 64 LINK FAILED ========
-------- shader 65 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 66 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 66 (native 66) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 64 LINK FAILED ========
-------- shader 65 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 66 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 66 (native 66) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 64 LINK FAILED ========
-------- shader 65 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 66 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 63 (native 63) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 61 LINK FAILED ========
-------- shader 62 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 63 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 72 (native 72) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 70 LINK FAILED ========
-------- shader 71 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 72 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 66 (native 66) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 64 LINK FAILED ========
-------- shader 65 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 66 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 66 (native 66) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 64 LINK FAILED ========
-------- shader 65 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 66 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 69 (native 69) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 67 LINK FAILED ========
-------- shader 68 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 69 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 69 (native 69) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 67 LINK FAILED ========
-------- shader 68 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 69 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 66 (native 66) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 64 LINK FAILED ========
-------- shader 65 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 66 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 75 (native 75) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 73 LINK FAILED ========
-------- shader 74 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 75 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 90 (native 90) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 88 LINK FAILED ========
-------- shader 89 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 90 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 84 (native 84) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 82 LINK FAILED ========
-------- shader 83 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 84 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 135 (native 135) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 133 LINK FAILED ========
-------- shader 134 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 135 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


==== COMPILE FAILED shader 99 (native 99) ====
DRIVER LOG:
WARNING: 0:8: extension 'GL_EXT_shader_implicit_conversions' is not supported
ERROR: 0:87: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'const float' and a right operand of type 'uniform int' (or there is no acceptable conversion)
ERROR: 1 compilation errors.  No code generated.


SOURCE:
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}


======== PROGRAM 97 LINK FAILED ========
-------- shader 98 type=0x8B31 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

in vec3 position;
in vec2 texcoord;

out vec2 uv;

void main()
{
gl_Position = vec4(2.0f * (position.xy - vec2(0.5f,0.5f)), 1.0, 1.0);
uv = texcoord;
}

-------- shader 99 type=0x8B30 --------
#version 320 es
#ifdef GL_EXT_shader_implicit_conversions 
#extension GL_EXT_shader_implicit_conversions : enable
#endif
#extension GL_EXT_shader_non_constant_global_initializers : enable
#extension GL_OES_standard_derivatives : enable
#extension GL_EXT_gpu_shader5 : enable
#extension GL_EXT_shader_implicit_conversions : enable
#extension GL_EXT_texture_cube_map_array : enable
#extension GL_EXT_texture_buffer : enable
#extension GL_OES_texture_storage_multisample_2d_array : enable
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp sampler2DShadow;
#define sample sample2
#define texture2D texture
#define texture3D texture
#define texture2DProj textureProj
#define texture2DLod textureLod
#define shadow2DProj textureProj
#define textureSize2D textureSize

#define BLUR_RANGE 2
#define MIN_SPREAD 2.0
#define MAX_SPREAD 16.0
#define BASE_OPACITY 0.022
out mediump vec4 vgpu_FragColor;

in vec2 uv;

uniform vec2 screenSize;
uniform vec2 displayOrigin;
uniform vec2 displaySize;
uniform vec2 texSize;
uniform sampler2D tex;
uniform sampler2D depth;
uniform vec2 TextureSize;
uniform float zoom;
uniform int opacityScale;

const float BLUR_SAMPLES = float( (float(BLUR_RANGE) * 2.0 + 1.0) * (float(BLUR_RANGE) * 2.0 + 1.0));
const float BLUR_SCALE = float( 1.0 / BLUR_SAMPLES);



void main()
{
// frag coord is in pixel units, needs to be converted to a 0.0 to 1.0 range
vec2 screenUV = (gl_FragCoord.xy - displayOrigin.xy) / displaySize;

vec4 vision = texture2D(tex, screenUV, 0.0);
float alpha = 0.0;

float zoomFactor = 1.0 / max(zoom, 0.1);
float spread = mix(MIN_SPREAD, MAX_SPREAD, zoomFactor * (vision.r * 4.0));

// texture res is typically bigger than the screen res
// need to clamp to rendered portion of the texture
// otherwise you get fading around the edges of the screen
vec2 maxUV = texSize / TextureSize;

// only writing depth for shadow polygons, so any blurring off the shadow is clipped
// need to only blur into the shadow area, edge of shadow = half on/off

ivec2 pixel = ivec2(gl_FragCoord.xy / screenSize * texSize);
vec2 pixelStep = vec2(1.0, 1.0) / TextureSize;

for (int y = -BLUR_RANGE; y <= BLUR_RANGE; y++)
{
for (int x = -BLUR_RANGE; x <= BLUR_RANGE; x++)
{
vec2 samUV = min(vec2((pixel + ivec2(x, y))) * pixelStep, maxUV);
vec4 sam = texture2D(tex, samUV, 0.0);
alpha += sam.a;
}
}

// alpha range is 0.0 to BLUR_SAMPLES
// edge of shadow would produce an alpha of BLUR_SAMPLES * 0.5

alpha -= BLUR_SAMPLES * 0.5; // (-0.5 to 0.5) * BLUR_SAMPLES, edge of shadow is now 0.0
alpha *= 2.0; // -BLUR_SAMPLES to BLUR_SAMPLES, edge of shadow is still 0.0
alpha *= BLUR_SCALE; // -1.0 to 1.0 (negative is clipped)

gl_FragDepth = texture2D(depth, screenUV, 0.0).r;
vgpu_FragColor =  vec4(0.0, 0.0, 0.0, alpha * (BASE_OPACITY * opacityScale));
}

