mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
93 lines
1.9 KiB
Text
93 lines
1.9 KiB
Text
struct v2f {
|
|
vec4 pos;
|
|
vec4 uv;
|
|
vec3 ray;
|
|
};
|
|
struct appdata {
|
|
vec4 vertex;
|
|
vec3 texcoord;
|
|
};
|
|
uniform vec4 _ProjectionParams;
|
|
vec4 ComputeScreenPos (
|
|
in vec4 pos_1
|
|
)
|
|
{
|
|
vec4 o_2;
|
|
vec4 tmpvar_3;
|
|
tmpvar_3 = (pos_1 * 0.5);
|
|
o_2 = tmpvar_3;
|
|
vec2 tmpvar_4;
|
|
tmpvar_4.x = o_2.x;
|
|
tmpvar_4.y = (o_2.y * _ProjectionParams.x);
|
|
vec2 tmpvar_5;
|
|
tmpvar_5 = (tmpvar_4 + o_2.w);
|
|
o_2.xy = tmpvar_5.xy.xy;
|
|
vec2 tmpvar_6;
|
|
tmpvar_6 = pos_1.zw;
|
|
o_2.zw = tmpvar_6.xxxy.zw;
|
|
return o_2;
|
|
}
|
|
|
|
v2f vert (
|
|
in appdata v_7
|
|
)
|
|
{
|
|
v2f o_8;
|
|
vec4 tmpvar_9;
|
|
tmpvar_9 = (gl_ModelViewProjectionMatrix * v_7.vertex);
|
|
o_8.pos = tmpvar_9;
|
|
vec4 tmpvar_10;
|
|
tmpvar_10 = ComputeScreenPos (o_8.pos);
|
|
vec4 tmpvar_11;
|
|
tmpvar_11 = tmpvar_10;
|
|
o_8.uv = tmpvar_11;
|
|
vec3 tmpvar_12;
|
|
tmpvar_12 = ((gl_ModelViewMatrix * v_7.vertex).xyz * vec3(-1.0, -1.0, 1.0));
|
|
o_8.ray = tmpvar_12;
|
|
vec3 tmpvar_13;
|
|
tmpvar_13 = vec3(float((v_7.texcoord.z != 0.0)));
|
|
vec3 tmpvar_14;
|
|
tmpvar_14 = mix (o_8.ray, v_7.texcoord, tmpvar_13);
|
|
vec3 tmpvar_15;
|
|
tmpvar_15 = tmpvar_14;
|
|
o_8.ray = tmpvar_15;
|
|
return o_8;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
appdata xlt_v_16;
|
|
v2f xl_retval_17;
|
|
vec4 tmpvar_18;
|
|
tmpvar_18 = gl_Vertex.xyzw;
|
|
vec4 tmpvar_19;
|
|
tmpvar_19 = tmpvar_18;
|
|
xlt_v_16.vertex = tmpvar_19;
|
|
vec3 tmpvar_20;
|
|
tmpvar_20 = gl_MultiTexCoord0.xyz;
|
|
vec3 tmpvar_21;
|
|
tmpvar_21 = tmpvar_20;
|
|
xlt_v_16.texcoord = tmpvar_21;
|
|
v2f tmpvar_22;
|
|
tmpvar_22 = vert (xlt_v_16);
|
|
v2f tmpvar_23;
|
|
tmpvar_23 = tmpvar_22;
|
|
xl_retval_17 = tmpvar_23;
|
|
vec4 tmpvar_24;
|
|
tmpvar_24 = xl_retval_17.pos.xyzw;
|
|
vec4 tmpvar_25;
|
|
tmpvar_25 = tmpvar_24;
|
|
gl_Position = tmpvar_25;
|
|
vec4 tmpvar_26;
|
|
tmpvar_26 = xl_retval_17.uv.xyzw;
|
|
vec4 tmpvar_27;
|
|
tmpvar_27 = tmpvar_26;
|
|
gl_TexCoord[0] = tmpvar_27;
|
|
vec4 tmpvar_28;
|
|
tmpvar_28.w = 0.0;
|
|
tmpvar_28.xyz = xl_retval_17.ray.xyz;
|
|
vec4 tmpvar_29;
|
|
tmpvar_29 = tmpvar_28;
|
|
gl_TexCoord[1] = tmpvar_29;
|
|
}
|
|
|