mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 00:31:28 -05:00
40 lines
1.3 KiB
Text
40 lines
1.3 KiB
Text
uniform vec4 _TreeBillboardCameraFront;
|
|
uniform vec4 _TreeBillboardCameraPos;
|
|
uniform vec3 _TreeBillboardCameraRight;
|
|
uniform vec4 _TreeBillboardCameraUp;
|
|
uniform vec4 _TreeBillboardDistances;
|
|
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;
|
|
}
|
|
|
|
|
|
// inputs: 3, stats: 23 alu 0 tex 1 flow
|