mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
65 lines
2 KiB
Text
65 lines
2 KiB
Text
varying highp vec3 xlv_TEXCOORD1;
|
|
varying highp vec2 xlv_TEXCOORD0;
|
|
uniform highp vec4 _ZBufferParams;
|
|
uniform highp mat4 _View2Shadow3;
|
|
uniform highp mat4 _View2Shadow2;
|
|
uniform highp mat4 _View2Shadow1;
|
|
uniform highp mat4 _View2Shadow;
|
|
uniform sampler2D _ShadowMapTexture;
|
|
uniform highp vec4 _LightSplitsNear;
|
|
uniform highp vec4 _LightSplitsFar;
|
|
uniform highp vec4 _LightShadowData;
|
|
uniform sampler2D _CameraDepthTexture;
|
|
void main ()
|
|
{
|
|
mediump vec4 tmpvar_1;
|
|
highp vec4 res;
|
|
highp float depth;
|
|
lowp float tmpvar_2;
|
|
tmpvar_2 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0).x;
|
|
depth = tmpvar_2;
|
|
highp float tmpvar_3;
|
|
tmpvar_3 = (1.0/(((_ZBufferParams.x * depth) + _ZBufferParams.y)));
|
|
depth = tmpvar_3;
|
|
highp vec4 tmpvar_4;
|
|
tmpvar_4.w = 1.0;
|
|
tmpvar_4.xyz = (xlv_TEXCOORD1 * tmpvar_3);
|
|
mediump float shadow_i0;
|
|
highp vec4 far;
|
|
highp vec4 near;
|
|
highp vec4 tmpvar_5;
|
|
tmpvar_5 = tmpvar_4.zzzz;
|
|
lowp vec4 tmpvar_6;
|
|
tmpvar_6 = vec4(greaterThanEqual (tmpvar_5, _LightSplitsNear));
|
|
near = tmpvar_6;
|
|
highp vec4 tmpvar_7;
|
|
tmpvar_7 = tmpvar_4.zzzz;
|
|
lowp vec4 tmpvar_8;
|
|
tmpvar_8 = vec4(lessThan (tmpvar_7, _LightSplitsFar));
|
|
far = tmpvar_8;
|
|
highp vec4 tmpvar_9;
|
|
tmpvar_9 = (near * far);
|
|
highp vec4 tmpvar_10;
|
|
tmpvar_10.w = 1.0;
|
|
tmpvar_10.xyz = (((((_View2Shadow * tmpvar_4).xyz * tmpvar_9.x) + ((_View2Shadow1 * tmpvar_4).xyz * tmpvar_9.y)) + ((_View2Shadow2 * tmpvar_4).xyz * tmpvar_9.z)) + ((_View2Shadow3 * tmpvar_4).xyz * tmpvar_9.w));
|
|
lowp vec4 tmpvar_11;
|
|
tmpvar_11 = texture2D (_ShadowMapTexture, tmpvar_10.xy);
|
|
highp float tmpvar_12;
|
|
if ((tmpvar_11.x < tmpvar_10.z)) {
|
|
tmpvar_12 = _LightShadowData.x;
|
|
} else {
|
|
tmpvar_12 = 1.0;
|
|
};
|
|
shadow_i0 = tmpvar_12;
|
|
res.x = shadow_i0;
|
|
res.y = 1.0;
|
|
highp vec2 enc;
|
|
highp vec2 tmpvar_13;
|
|
tmpvar_13 = fract ((vec2(1.0, 255.0) * (1.0 - tmpvar_3)));
|
|
enc = tmpvar_13;
|
|
enc.x = (tmpvar_13.x - (tmpvar_13.y * 0.00392157));
|
|
res.zw = enc;
|
|
tmpvar_1 = res;
|
|
gl_FragData[0] = tmpvar_1;
|
|
}
|
|
|