mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
88 lines
2.9 KiB
Text
88 lines
2.9 KiB
Text
uniform mat4 _LightMatrix0;
|
|
uniform vec4 _MainTex_ST;
|
|
uniform mat4 _Object2World;
|
|
uniform vec4 _WaveAndDistance;
|
|
uniform vec4 _WavingTint;
|
|
uniform vec4 _WorldSpaceLightPos0;
|
|
uniform vec4 unity_Scale;
|
|
varying vec4 xlv_FOG;
|
|
void main ()
|
|
{
|
|
vec4 vertex_1;
|
|
vertex_1.yw = gl_Vertex.yw;
|
|
vec4 outColor_2;
|
|
vec3 waveMove_3;
|
|
float lighting_4;
|
|
vec4 s_5;
|
|
vec4 waves_6;
|
|
waveMove_3.y = 0.0;
|
|
waves_6 = (gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
|
|
waves_6 = (waves_6 + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
|
|
waves_6 = (waves_6 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)));
|
|
vec4 tmpvar_7;
|
|
tmpvar_7 = fract(waves_6);
|
|
waves_6 = tmpvar_7;
|
|
vec4 val_8;
|
|
vec4 s_9;
|
|
vec4 r2_10;
|
|
vec4 r1_11;
|
|
vec4 r5_12;
|
|
val_8 = ((tmpvar_7 * 6.40885) - 3.14159);
|
|
r5_12 = (val_8 * val_8);
|
|
r1_11 = (r5_12 * val_8);
|
|
r2_10 = (r1_11 * r5_12);
|
|
s_9 = (((val_8 +
|
|
(r1_11 * -0.161616)
|
|
) + (r2_10 * 0.0083333)) + ((r2_10 * r5_12) * -0.00019841));
|
|
s_5 = (s_9 * s_9);
|
|
s_5 = (s_5 * s_5);
|
|
lighting_4 = (dot (s_5, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7);
|
|
s_5 = (s_5 * (gl_Color.w * _WaveAndDistance.z));
|
|
waveMove_3.x = dot (s_5, vec4(0.024, 0.04, -0.12, 0.096));
|
|
waveMove_3.z = dot (s_5, vec4(0.006, 0.02, -0.02, 0.1));
|
|
vertex_1.xz = (gl_Vertex.xz - (waveMove_3.xz * _WaveAndDistance.z));
|
|
outColor_2.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_4))) * 2.0);
|
|
outColor_2.w = 1.0;
|
|
vec4 pos_13;
|
|
pos_13 = (gl_ModelViewProjectionMatrix * vertex_1);
|
|
mat3 tmpvar_14;
|
|
tmpvar_14[0] = _Object2World[0].xyz;
|
|
tmpvar_14[1] = _Object2World[1].xyz;
|
|
tmpvar_14[2] = _Object2World[2].xyz;
|
|
gl_Position = pos_13;
|
|
vec4 tmpvar_15;
|
|
tmpvar_15.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_15.x = pos_13.z;
|
|
xlv_FOG = tmpvar_15;
|
|
vec4 tmpvar_16;
|
|
tmpvar_16.zw = vec2(0.0, 0.0);
|
|
tmpvar_16.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
|
gl_TexCoord[0] = tmpvar_16;
|
|
gl_FrontColor = outColor_2;
|
|
vec4 tmpvar_17;
|
|
tmpvar_17.w = 0.0;
|
|
tmpvar_17.xyz = (tmpvar_14 * (gl_Normal * unity_Scale.w));
|
|
gl_TexCoord[1] = tmpvar_17;
|
|
vec4 tmpvar_18;
|
|
tmpvar_18.w = 0.0;
|
|
tmpvar_18.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * vertex_1).xyz);
|
|
gl_TexCoord[2] = tmpvar_18;
|
|
gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * vertex_1));
|
|
}
|
|
|
|
|
|
// stats: 48 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: 8 (total size: 0)
|
|
// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
|
|
// #1: _LightMatrix0 (high float) 4x4 [-1]
|
|
// #2: _MainTex_ST (high float) 4x1 [-1]
|
|
// #3: _Object2World (high float) 4x4 [-1]
|
|
// #4: _WaveAndDistance (high float) 4x1 [-1]
|
|
// #5: _WavingTint (high float) 4x1 [-1]
|
|
// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1]
|
|
// #7: unity_Scale (high float) 4x1 [-1]
|