mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
44 lines
1.4 KiB
Text
44 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;
|
|
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));
|
|
vec4 tmpvar_6;
|
|
tmpvar_6 = (gl_ModelViewProjectionMatrix * pos);
|
|
tmpvar_1.x = gl_MultiTexCoord0.x;
|
|
tmpvar_1.y = float((gl_MultiTexCoord0.y > 0.0));
|
|
gl_Position = tmpvar_6;
|
|
vec4 tmpvar_7;
|
|
tmpvar_7.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_7.x = tmpvar_6.z;
|
|
xlv_FOG = tmpvar_7;
|
|
gl_FrontColor = gl_Color;
|
|
vec4 tmpvar_8;
|
|
tmpvar_8.zw = vec2(0.0, 0.0);
|
|
tmpvar_8.xy = tmpvar_1;
|
|
gl_TexCoord[0] = tmpvar_8;
|
|
}
|
|
|