mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
41 lines
1.4 KiB
Text
41 lines
1.4 KiB
Text
uniform vec4 _TerrainTreeLightColors[4];
|
|
uniform vec3 _TerrainTreeLightDirections[4];
|
|
void main ()
|
|
{
|
|
vec3 lightColor_1;
|
|
lightColor_1 = gl_LightModel.ambient.xyz;
|
|
lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0,
|
|
dot (_TerrainTreeLightDirections[0], gl_Normal)
|
|
)).xyz);
|
|
lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0,
|
|
dot (_TerrainTreeLightDirections[1], gl_Normal)
|
|
)).xyz);
|
|
lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0,
|
|
dot (_TerrainTreeLightDirections[2], gl_Normal)
|
|
)).xyz);
|
|
lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0,
|
|
dot (_TerrainTreeLightDirections[3], gl_Normal)
|
|
)).xyz);
|
|
gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
|
|
vec4 tmpvar_2;
|
|
tmpvar_2.zw = vec2(0.0, 0.0);
|
|
tmpvar_2.xy = gl_MultiTexCoord0.xy;
|
|
gl_TexCoord[0] = tmpvar_2;
|
|
vec4 tmpvar_3;
|
|
tmpvar_3.w = 0.0;
|
|
tmpvar_3.xyz = (lightColor_1 * gl_Color.w);
|
|
gl_TexCoord[1] = tmpvar_3;
|
|
}
|
|
|
|
|
|
// stats: 20 alu 0 tex 0 flow
|
|
// inputs: 4
|
|
// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
|
|
// #1: gl_Color (high float) 4x1 [-1] loc 3
|
|
// #2: gl_Normal (high float) 3x1 [-1] loc 2
|
|
// #3: gl_Vertex (high float) 4x1 [-1] loc 0
|
|
// uniforms: 4 (total size: 0)
|
|
// #0: gl_LightModel (high other) 0x0 [-1]
|
|
// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
|
|
// #2: _TerrainTreeLightColors (high float) 4x1 [4]
|
|
// #3: _TerrainTreeLightDirections (high float) 3x1 [4]
|