mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
72 lines
2.6 KiB
Text
72 lines
2.6 KiB
Text
attribute vec4 TANGENT;
|
|
uniform vec4 unity_Scale;
|
|
uniform vec3 _WorldSpaceCameraPos;
|
|
uniform mat4 _World2Object;
|
|
uniform float _TranslucencyViewDependency;
|
|
uniform vec3 _TerrainTreeLightDirections[4];
|
|
void main ()
|
|
{
|
|
vec3 viewDir_1;
|
|
vec3 tmpvar_2;
|
|
vec3 tmpvar_3;
|
|
vec3 tmpvar_4;
|
|
float tmpvar_5;
|
|
tmpvar_5 = (1.0 - abs(TANGENT.w));
|
|
vec4 tmpvar_6;
|
|
tmpvar_6.w = 0.0;
|
|
tmpvar_6.xyz = gl_Normal;
|
|
vec4 tmpvar_7;
|
|
tmpvar_7.zw = vec2(0.0, 0.0);
|
|
tmpvar_7.xy = gl_Normal.xy;
|
|
vec4 tmpvar_8;
|
|
tmpvar_8 = (gl_Vertex + ((tmpvar_7 * gl_ModelViewMatrixInverseTranspose) * tmpvar_5));
|
|
vec3 tmpvar_9;
|
|
tmpvar_9 = mix (gl_Normal, normalize((tmpvar_6 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_5));
|
|
vec4 tmpvar_10;
|
|
tmpvar_10.w = 1.0;
|
|
tmpvar_10.xyz = _WorldSpaceCameraPos;
|
|
viewDir_1 = normalize((((_World2Object * tmpvar_10).xyz * unity_Scale.w) - tmpvar_8.xyz));
|
|
vec3 tmpvar_11;
|
|
tmpvar_11 = _TerrainTreeLightDirections[0];
|
|
float tmpvar_12;
|
|
tmpvar_12 = dot (tmpvar_9, tmpvar_11);
|
|
tmpvar_2.x = (mix (clamp (-(tmpvar_12), 0.0, 1.0), clamp (dot (viewDir_1, -(tmpvar_11)), 0.0, 1.0), _TranslucencyViewDependency) * 2.0);
|
|
tmpvar_3.x = max (0.0, ((tmpvar_12 * 0.6) + 0.4));
|
|
tmpvar_4.x = max (0.0, dot (tmpvar_9, normalize((tmpvar_11 + viewDir_1))));
|
|
vec3 tmpvar_13;
|
|
tmpvar_13 = _TerrainTreeLightDirections[1];
|
|
float tmpvar_14;
|
|
tmpvar_14 = dot (tmpvar_9, tmpvar_13);
|
|
tmpvar_2.y = (mix (clamp (-(tmpvar_14), 0.0, 1.0), clamp (dot (viewDir_1, -(tmpvar_13)), 0.0, 1.0), _TranslucencyViewDependency) * 2.0);
|
|
tmpvar_3.y = max (0.0, ((tmpvar_14 * 0.6) + 0.4));
|
|
tmpvar_4.y = max (0.0, dot (tmpvar_9, normalize((tmpvar_13 + viewDir_1))));
|
|
vec3 tmpvar_15;
|
|
tmpvar_15 = _TerrainTreeLightDirections[2];
|
|
float tmpvar_16;
|
|
tmpvar_16 = dot (tmpvar_9, tmpvar_15);
|
|
tmpvar_2.z = (mix (clamp (-(tmpvar_16), 0.0, 1.0), clamp (dot (viewDir_1, -(tmpvar_15)), 0.0, 1.0), _TranslucencyViewDependency) * 2.0);
|
|
tmpvar_3.z = max (0.0, ((tmpvar_16 * 0.6) + 0.4));
|
|
tmpvar_4.z = max (0.0, dot (tmpvar_9, normalize((tmpvar_15 + viewDir_1))));
|
|
gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_8);
|
|
vec4 tmpvar_17;
|
|
tmpvar_17.zw = vec2(0.0, 0.0);
|
|
tmpvar_17.xy = gl_MultiTexCoord0.xy;
|
|
gl_TexCoord[0] = tmpvar_17;
|
|
vec4 tmpvar_18;
|
|
tmpvar_18.w = 0.0;
|
|
tmpvar_18.xyz = gl_Color.www;
|
|
gl_TexCoord[1] = tmpvar_18;
|
|
vec4 tmpvar_19;
|
|
tmpvar_19.w = 0.0;
|
|
tmpvar_19.xyz = tmpvar_2;
|
|
gl_TexCoord[2] = tmpvar_19;
|
|
vec4 tmpvar_20;
|
|
tmpvar_20.w = 0.0;
|
|
tmpvar_20.xyz = tmpvar_3;
|
|
gl_TexCoord[3] = tmpvar_20;
|
|
vec4 tmpvar_21;
|
|
tmpvar_21.w = 0.0;
|
|
tmpvar_21.xyz = tmpvar_4;
|
|
gl_TexCoord[4] = tmpvar_21;
|
|
}
|
|
|