mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
36 lines
1.2 KiB
Text
36 lines
1.2 KiB
Text
uniform mat4 _TerrainEngineBendTree;
|
|
uniform vec4 _SquashPlaneNormal;
|
|
uniform float _SquashAmount;
|
|
uniform vec4 _Scale;
|
|
uniform vec4 _ProjectionParams;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
vec4 pos_2;
|
|
pos_2.w = gl_Vertex.w;
|
|
pos_2.xyz = (gl_Vertex.xyz * _Scale.xyz);
|
|
vec4 tmpvar_3;
|
|
tmpvar_3.w = 0.0;
|
|
tmpvar_3.xyz = pos_2.xyz;
|
|
pos_2.xyz = mix (pos_2.xyz, (_TerrainEngineBendTree * tmpvar_3).xyz, gl_Color.www);
|
|
vec3 tmpvar_4;
|
|
tmpvar_4.xz = vec2(0.0, 0.0);
|
|
tmpvar_4.y = _SquashPlaneNormal.w;
|
|
vec4 tmpvar_5;
|
|
tmpvar_5.w = 1.0;
|
|
tmpvar_5.xyz = mix ((pos_2.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_4 - pos_2.xyz)) * _SquashPlaneNormal.xyz)), pos_2.xyz, vec3(_SquashAmount));
|
|
pos_2 = tmpvar_5;
|
|
mat3 tmpvar_6;
|
|
tmpvar_6[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
|
|
tmpvar_6[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
|
|
tmpvar_6[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
|
|
tmpvar_1.xyz = (tmpvar_6 * gl_Normal);
|
|
tmpvar_1.w = -(((gl_ModelViewMatrix * tmpvar_5).z * _ProjectionParams.w));
|
|
gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_5);
|
|
vec4 tmpvar_7;
|
|
tmpvar_7.zw = vec2(0.0, 0.0);
|
|
tmpvar_7.xy = gl_MultiTexCoord0.xy;
|
|
gl_TexCoord[0] = tmpvar_7;
|
|
gl_TexCoord[1] = tmpvar_1;
|
|
}
|
|
|