bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt
2012-10-07 20:41:18 -07:00

34 lines
1.2 KiB
Text

uniform vec4 _TreeBillboardDistances;
uniform vec4 _TreeBillboardCameraUp;
uniform vec3 _TreeBillboardCameraRight;
uniform vec4 _TreeBillboardCameraPos;
uniform vec4 _TreeBillboardCameraFront;
void main ()
{
vec2 tmpvar_1;
vec4 pos_2;
pos_2 = gl_Vertex;
vec2 offset_3;
offset_3 = gl_MultiTexCoord1.xy;
vec3 tmpvar_4;
tmpvar_4 = (gl_Vertex.xyz - _TreeBillboardCameraPos.xyz);
float tmpvar_5;
tmpvar_5 = dot (tmpvar_4, tmpvar_4);
if ((tmpvar_5 > _TreeBillboardDistances.x)) {
offset_3 = vec2(0.0, 0.0);
};
pos_2.xyz = (gl_Vertex.xyz + (_TreeBillboardCameraRight * offset_3.x));
float tmpvar_6;
tmpvar_6 = mix (offset_3.y, gl_MultiTexCoord0.y, _TreeBillboardCameraPos.w);
float tmpvar_7;
tmpvar_7 = abs(tmpvar_6);
pos_2.xyz = (pos_2.xyz + mix (((((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_6)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_7)) - ((_TreeBillboardCameraUp.xyz * tmpvar_7) * _TreeBillboardCameraFront.w)), (_TreeBillboardCameraUp.xyz * tmpvar_6), _TreeBillboardCameraUp.www));
tmpvar_1.x = gl_MultiTexCoord0.x;
tmpvar_1.y = float((gl_MultiTexCoord0.y > 0.0));
gl_Position = (gl_ModelViewProjectionMatrix * pos_2);
vec4 tmpvar_8;
tmpvar_8.zw = vec2(0.0, 0.0);
tmpvar_8.xy = tmpvar_1;
gl_TexCoord[0] = tmpvar_8;
}