bgfx/3rdparty/glsl-optimizer/tests/vertex/complex-prepasslight-irES.txt
Branimir Karadzic dee3fe5266 Initial commit.
2012-04-03 20:30:07 -07:00

101 lines
2.3 KiB
Text

struct v2f {
highp vec4 pos;
highp vec4 uv;
highp vec3 ray;
};
struct appdata {
highp vec4 vertex;
highp vec3 normal;
};
varying highp vec3 xlv_TEXCOORD1;
varying highp vec4 xlv_TEXCOORD0;
uniform highp mat4 glstate_matrix_mvp;
uniform highp mat4 glstate_matrix_modelview0;
uniform highp vec4 _ProjectionParams;
attribute lowp vec4 _glesColor;
attribute highp vec4 _glesMultiTexCoord1;
attribute highp vec4 _glesMultiTexCoord0;
attribute mediump vec3 _glesNormal;
attribute highp vec4 _glesVertex;
vec4 ComputeScreenPos (
in highp vec4 pos
)
{
highp vec4 o;
highp vec4 tmpvar_1;
tmpvar_1 = (pos * 0.5);
o = tmpvar_1;
highp vec2 tmpvar_2;
tmpvar_2.x = o.x;
tmpvar_2.y = (o.y * _ProjectionParams.x);
highp vec2 tmpvar_3;
tmpvar_3 = (tmpvar_2 + o.w);
o.xy = tmpvar_3.xy.xy;
highp vec2 tmpvar_4;
tmpvar_4 = pos.zw;
o.zw = tmpvar_4.xxxy.zw;
return o;
}
v2f xlat_main (
in appdata v
)
{
v2f o;
highp vec4 tmpvar_1;
tmpvar_1 = (glstate_matrix_mvp * v.vertex);
o.pos = tmpvar_1;
highp vec4 tmpvar_2;
tmpvar_2 = ComputeScreenPos (o.pos);
highp vec4 tmpvar_3;
tmpvar_3 = tmpvar_2;
o.uv = tmpvar_3;
highp vec3 tmpvar_4;
tmpvar_4 = ((glstate_matrix_modelview0 * v.vertex).xyz * vec3(-1.0, -1.0, 1.0));
o.ray = tmpvar_4;
highp vec3 tmpvar_5;
tmpvar_5 = vec3(float((v.normal.z != 0.0)));
highp vec3 tmpvar_6;
tmpvar_6 = mix (o.ray, v.normal, tmpvar_5);
highp vec3 tmpvar_7;
tmpvar_7 = tmpvar_6;
o.ray = tmpvar_7;
return o;
}
void main ()
{
appdata xlt_v;
v2f xl_retval;
highp vec4 tmpvar_1;
tmpvar_1 = _glesVertex.xyzw;
highp vec4 tmpvar_2;
tmpvar_2 = tmpvar_1;
xlt_v.vertex = tmpvar_2;
highp vec3 tmpvar_3;
tmpvar_3 = _glesNormal.xyz;
highp vec3 tmpvar_4;
tmpvar_4 = tmpvar_3;
xlt_v.normal = tmpvar_4;
v2f tmpvar_5;
tmpvar_5 = xlat_main (xlt_v);
v2f tmpvar_6;
tmpvar_6 = tmpvar_5;
xl_retval = tmpvar_6;
highp vec4 tmpvar_7;
tmpvar_7 = xl_retval.pos.xyzw;
highp vec4 tmpvar_8;
tmpvar_8 = tmpvar_7;
gl_Position = tmpvar_8;
highp vec4 tmpvar_9;
tmpvar_9 = xl_retval.uv.xyzw;
highp vec4 tmpvar_10;
tmpvar_10 = tmpvar_9;
xlv_TEXCOORD0 = tmpvar_10;
highp vec3 tmpvar_11;
tmpvar_11 = xl_retval.ray.xyz;
highp vec3 tmpvar_12;
tmpvar_12 = tmpvar_11;
xlv_TEXCOORD1 = tmpvar_12;
}