mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
50 lines
1.5 KiB
Text
50 lines
1.5 KiB
Text
uniform vec4 _LightShadowData;
|
|
uniform vec4 _LightSplitsFar;
|
|
uniform vec4 _LightSplitsNear;
|
|
uniform vec4 _ProjectionParams;
|
|
uniform sampler2D _ShadowMapTexture;
|
|
void main ()
|
|
{
|
|
vec2 tmpvar_1;
|
|
tmpvar_1 = gl_TexCoord[4].xy;
|
|
vec4 res_2;
|
|
vec4 weights_3;
|
|
weights_3 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar)));
|
|
vec4 tmpvar_4;
|
|
tmpvar_4.w = 1.0;
|
|
tmpvar_4.xyz = (((
|
|
(gl_TexCoord[0].xyz * weights_3.x)
|
|
+
|
|
(gl_TexCoord[1].xyz * weights_3.y)
|
|
) + (gl_TexCoord[2].xyz * weights_3.z)) + (gl_TexCoord[3].xyz * weights_3.w));
|
|
vec4 tmpvar_5;
|
|
tmpvar_5 = texture2D (_ShadowMapTexture, tmpvar_4.xy);
|
|
float tmpvar_6;
|
|
if ((tmpvar_5.x < tmpvar_4.z)) {
|
|
tmpvar_6 = _LightShadowData.x;
|
|
} else {
|
|
tmpvar_6 = 1.0;
|
|
};
|
|
res_2.x = clamp ((tmpvar_6 + clamp (tmpvar_1.y, 0.0, 1.0)), 0.0, 1.0);
|
|
res_2.y = 1.0;
|
|
vec2 enc_7;
|
|
enc_7 = (vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x);
|
|
vec2 tmpvar_8;
|
|
tmpvar_8 = fract(enc_7);
|
|
enc_7.y = tmpvar_8.y;
|
|
enc_7.x = (tmpvar_8.x - (tmpvar_8.y * 0.00392157));
|
|
res_2.zw = enc_7;
|
|
gl_FragData[0] = res_2;
|
|
}
|
|
|
|
|
|
// stats: 25 alu 1 tex 1 flow
|
|
// inputs: 1
|
|
// #0: gl_TexCoord (high float) 4x1 [5] loc 4
|
|
// uniforms: 4 (total size: 0)
|
|
// #0: _LightShadowData (high float) 4x1 [-1]
|
|
// #1: _LightSplitsFar (high float) 4x1 [-1]
|
|
// #2: _LightSplitsNear (high float) 4x1 [-1]
|
|
// #3: _ProjectionParams (high float) 4x1 [-1]
|
|
// textures: 1
|
|
// #0: _ShadowMapTexture (high 2d) 0x0 [-1]
|