mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
64 lines
2.3 KiB
Text
64 lines
2.3 KiB
Text
|
varying vec4 xlv_FOG;
|
||
|
uniform vec4 unity_Scale;
|
||
|
uniform vec4 _WorldSpaceLightPos0;
|
||
|
uniform vec4 _WavingTint;
|
||
|
uniform vec4 _WaveAndDistance;
|
||
|
uniform mat4 _Object2World;
|
||
|
uniform vec4 _MainTex_ST;
|
||
|
uniform mat4 _LightMatrix0;
|
||
|
void main ()
|
||
|
{
|
||
|
vec4 vertex;
|
||
|
vertex = gl_Vertex;
|
||
|
vec4 outColor;
|
||
|
vec3 waveMove;
|
||
|
waveMove = vec3(0.0, 0.0, 0.0);
|
||
|
vec4 tmpvar_1;
|
||
|
tmpvar_1 = ((fract ((((gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)))) * 6.40885) - 3.14159);
|
||
|
vec4 tmpvar_2;
|
||
|
tmpvar_2 = (tmpvar_1 * tmpvar_1);
|
||
|
vec4 tmpvar_3;
|
||
|
tmpvar_3 = (tmpvar_2 * tmpvar_1);
|
||
|
vec4 tmpvar_4;
|
||
|
tmpvar_4 = (tmpvar_3 * tmpvar_2);
|
||
|
vec4 tmpvar_5;
|
||
|
tmpvar_5 = (((tmpvar_1 + (tmpvar_3 * -0.161616)) + (tmpvar_4 * 0.0083333)) + ((tmpvar_4 * tmpvar_2) * -0.00019841));
|
||
|
vec4 tmpvar_6;
|
||
|
tmpvar_6 = (tmpvar_5 * tmpvar_5);
|
||
|
vec4 tmpvar_7;
|
||
|
tmpvar_7 = (tmpvar_6 * tmpvar_6);
|
||
|
vec4 tmpvar_8;
|
||
|
tmpvar_8 = (tmpvar_7 * (gl_Color.w * _WaveAndDistance.z));
|
||
|
waveMove.x = dot (tmpvar_8, vec4(0.024, 0.04, -0.12, 0.096));
|
||
|
waveMove.z = dot (tmpvar_8, vec4(0.006, 0.02, -0.02, 0.1));
|
||
|
vertex.xz = (gl_Vertex.xz - (waveMove.xz * _WaveAndDistance.z));
|
||
|
outColor.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3((dot (tmpvar_7, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7)))) * 2.0);
|
||
|
outColor.w = 1.0;
|
||
|
vec4 tmpvar_9;
|
||
|
tmpvar_9 = (gl_ModelViewProjectionMatrix * vertex);
|
||
|
mat3 tmpvar_10;
|
||
|
tmpvar_10[0] = _Object2World[0].xyz;
|
||
|
tmpvar_10[1] = _Object2World[1].xyz;
|
||
|
tmpvar_10[2] = _Object2World[2].xyz;
|
||
|
gl_Position = tmpvar_9;
|
||
|
vec4 tmpvar_11;
|
||
|
tmpvar_11.yzw = vec3(0.0, 0.0, 0.0);
|
||
|
tmpvar_11.x = tmpvar_9.z;
|
||
|
xlv_FOG = tmpvar_11;
|
||
|
vec4 tmpvar_12;
|
||
|
tmpvar_12.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_12.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
||
|
gl_TexCoord[0] = tmpvar_12;
|
||
|
gl_FrontColor = outColor;
|
||
|
vec4 tmpvar_13;
|
||
|
tmpvar_13.w = 0.0;
|
||
|
tmpvar_13.xyz = (tmpvar_10 * (gl_Normal * unity_Scale.w));
|
||
|
gl_TexCoord[1] = tmpvar_13;
|
||
|
vec4 tmpvar_14;
|
||
|
tmpvar_14.w = 0.0;
|
||
|
tmpvar_14.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * vertex).xyz);
|
||
|
gl_TexCoord[2] = tmpvar_14;
|
||
|
gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * vertex));
|
||
|
}
|
||
|
|