mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
60 lines
2 KiB
Text
60 lines
2 KiB
Text
uniform vec4 _TreeBillboardCameraFront;
|
|
uniform vec4 _TreeBillboardCameraPos;
|
|
uniform vec3 _TreeBillboardCameraRight;
|
|
uniform vec4 _TreeBillboardCameraUp;
|
|
uniform vec4 _TreeBillboardDistances;
|
|
varying vec4 xlv_FOG;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
vec2 tmpvar_2;
|
|
vec4 pos_3;
|
|
pos_3 = gl_Vertex;
|
|
vec2 offset_4;
|
|
offset_4 = gl_MultiTexCoord1.xy;
|
|
vec3 treePos_5;
|
|
treePos_5 = (gl_Vertex.xyz - _TreeBillboardCameraPos.xyz);
|
|
float tmpvar_6;
|
|
tmpvar_6 = dot (treePos_5, treePos_5);
|
|
if ((tmpvar_6 > _TreeBillboardDistances.x)) {
|
|
offset_4 = vec2(0.0, 0.0);
|
|
};
|
|
pos_3.xyz = (gl_Vertex.xyz + (_TreeBillboardCameraRight * offset_4.x));
|
|
float tmpvar_7;
|
|
tmpvar_7 = mix (offset_4.y, gl_MultiTexCoord0.y, _TreeBillboardCameraPos.w);
|
|
float tmpvar_8;
|
|
tmpvar_8 = abs(tmpvar_7);
|
|
pos_3.xyz = (pos_3.xyz + mix ((
|
|
(((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_7)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_8))
|
|
-
|
|
((_TreeBillboardCameraUp.xyz * tmpvar_8) * _TreeBillboardCameraFront.w)
|
|
), (_TreeBillboardCameraUp.xyz * tmpvar_7), _TreeBillboardCameraUp.www));
|
|
tmpvar_1 = (gl_ModelViewProjectionMatrix * pos_3);
|
|
tmpvar_2.x = gl_MultiTexCoord0.x;
|
|
tmpvar_2.y = float((gl_MultiTexCoord0.y > 0.0));
|
|
gl_Position = tmpvar_1;
|
|
vec4 tmpvar_9;
|
|
tmpvar_9.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_9.x = tmpvar_1.z;
|
|
xlv_FOG = tmpvar_9;
|
|
gl_FrontColor = gl_Color;
|
|
vec4 tmpvar_10;
|
|
tmpvar_10.zw = vec2(0.0, 0.0);
|
|
tmpvar_10.xy = tmpvar_2;
|
|
gl_TexCoord[0] = tmpvar_10;
|
|
}
|
|
|
|
|
|
// stats: 24 alu 0 tex 1 flow
|
|
// inputs: 4
|
|
// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
|
|
// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
|
|
// #2: gl_Color (high float) 4x1 [-1] loc 3
|
|
// #3: 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]
|