mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
51 lines
1.8 KiB
Text
51 lines
1.8 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 treePos_4;
|
|
treePos_4 = (gl_Vertex.xyz - _TreeBillboardCameraPos.xyz);
|
|
float tmpvar_5;
|
|
tmpvar_5 = dot (treePos_4, treePos_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;
|
|
}
|
|
|
|
|
|
// stats: 23 alu 0 tex 1 flow
|
|
// inputs: 3
|
|
// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
|
|
// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
|
|
// #2: gl_Vertex (high float) 4x1 [-1] loc 0
|
|
// uniforms: 6 (total size: 0)
|
|
// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
|
|
// #1: _TreeBillboardCameraFront (high float) 4x1 [-1]
|
|
// #2: _TreeBillboardCameraPos (high float) 4x1 [-1]
|
|
// #3: _TreeBillboardCameraRight (high float) 3x1 [-1]
|
|
// #4: _TreeBillboardCameraUp (high float) 4x1 [-1]
|
|
// #5: _TreeBillboardDistances (high float) 4x1 [-1]
|