bgfx/3rdparty/glsl-optimizer/tests/vertex/unity-Hidden_Camera-DepthTexture-out.txt
Branimir Karadzic dee3fe5266 Initial commit.
2012-04-03 20:30:07 -07:00

36 lines
1.3 KiB
Text

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