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

42 lines
1.4 KiB
Text

varying vec4 xlv_FOG;
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));
vec4 tmpvar_8;
tmpvar_8 = (gl_ModelViewProjectionMatrix * pos_2);
tmpvar_1.x = gl_MultiTexCoord0.x;
tmpvar_1.y = float((gl_MultiTexCoord0.y > 0.0));
gl_Position = tmpvar_8;
vec4 tmpvar_9;
tmpvar_9.yzw = vec3(0.0, 0.0, 0.0);
tmpvar_9.x = tmpvar_8.z;
xlv_FOG = tmpvar_9;
gl_FrontColor = gl_Color;
vec4 tmpvar_10;
tmpvar_10.zw = vec2(0.0, 0.0);
tmpvar_10.xy = tmpvar_1;
gl_TexCoord[0] = tmpvar_10;
}