mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
90 lines
2.9 KiB
Text
90 lines
2.9 KiB
Text
uniform vec4 _CameraPosition;
|
|
uniform vec3 _CameraRight;
|
|
uniform vec3 _CameraUp;
|
|
uniform vec4 _MainTex_ST;
|
|
uniform vec4 _WaveAndDistance;
|
|
uniform vec4 _WavingTint;
|
|
uniform vec4 unity_LightShadowBias;
|
|
attribute vec4 TANGENT;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
vec2 tmpvar_2;
|
|
vec4 pos_3;
|
|
pos_3 = gl_Vertex;
|
|
vec2 offset_4;
|
|
offset_4 = TANGENT.xy;
|
|
vec3 grasspos_5;
|
|
grasspos_5 = (gl_Vertex.xyz - _CameraPosition.xyz);
|
|
float tmpvar_6;
|
|
tmpvar_6 = dot (grasspos_5, grasspos_5);
|
|
if ((tmpvar_6 > _WaveAndDistance.w)) {
|
|
offset_4 = vec2(0.0, 0.0);
|
|
};
|
|
pos_3.xyz = (gl_Vertex.xyz + (offset_4.x * _CameraRight));
|
|
pos_3.xyz = (pos_3.xyz + (offset_4.y * _CameraUp));
|
|
vec4 vertex_7;
|
|
vertex_7.yw = pos_3.yw;
|
|
vec4 outColor_8;
|
|
vec3 waveMove_9;
|
|
float lighting_10;
|
|
vec4 s_11;
|
|
vec4 waves_12;
|
|
waveMove_9.y = 0.0;
|
|
waves_12 = (pos_3.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
|
|
waves_12 = (waves_12 + (pos_3.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
|
|
waves_12 = (waves_12 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)));
|
|
vec4 tmpvar_13;
|
|
tmpvar_13 = fract(waves_12);
|
|
waves_12 = tmpvar_13;
|
|
vec4 val_14;
|
|
vec4 s_15;
|
|
vec4 r2_16;
|
|
vec4 r1_17;
|
|
vec4 r5_18;
|
|
val_14 = ((tmpvar_13 * 6.40885) - 3.14159);
|
|
r5_18 = (val_14 * val_14);
|
|
r1_17 = (r5_18 * val_14);
|
|
r2_16 = (r1_17 * r5_18);
|
|
s_15 = (((val_14 +
|
|
(r1_17 * -0.161616)
|
|
) + (r2_16 * 0.0083333)) + ((r2_16 * r5_18) * -0.00019841));
|
|
s_11 = (s_15 * s_15);
|
|
s_11 = (s_11 * s_11);
|
|
lighting_10 = (dot (s_11, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7);
|
|
s_11 = (s_11 * TANGENT.y);
|
|
waveMove_9.x = dot (s_11, vec4(0.024, 0.04, -0.12, 0.096));
|
|
waveMove_9.z = dot (s_11, vec4(0.006, 0.02, -0.02, 0.1));
|
|
vertex_7.xz = (pos_3.xz - (waveMove_9.xz * _WaveAndDistance.z));
|
|
outColor_8.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_10))) * 2.0);
|
|
outColor_8.w = 1.0;
|
|
tmpvar_2 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
|
tmpvar_1 = (gl_ModelViewProjectionMatrix * vertex_7);
|
|
tmpvar_1.z = (tmpvar_1.z + unity_LightShadowBias.x);
|
|
if ((tmpvar_1.z < -(tmpvar_1.w))) {
|
|
tmpvar_1.z = -(tmpvar_1.w);
|
|
};
|
|
gl_Position = tmpvar_1;
|
|
vec4 tmpvar_19;
|
|
tmpvar_19.zw = vec2(0.0, 0.0);
|
|
tmpvar_19.xy = tmpvar_2;
|
|
gl_TexCoord[1] = tmpvar_19;
|
|
gl_FrontColor = outColor_8;
|
|
}
|
|
|
|
|
|
// stats: 50 alu 0 tex 2 flow
|
|
// inputs: 4
|
|
// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
|
|
// #1: gl_Color (high float) 4x1 [-1] loc 3
|
|
// #2: gl_Vertex (high float) 4x1 [-1] loc 0
|
|
// #3: TANGENT (high float) 4x1 [-1]
|
|
// uniforms: 8 (total size: 0)
|
|
// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
|
|
// #1: _CameraPosition (high float) 4x1 [-1]
|
|
// #2: _CameraRight (high float) 3x1 [-1]
|
|
// #3: _CameraUp (high float) 3x1 [-1]
|
|
// #4: _MainTex_ST (high float) 4x1 [-1]
|
|
// #5: _WaveAndDistance (high float) 4x1 [-1]
|
|
// #6: _WavingTint (high float) 4x1 [-1]
|
|
// #7: unity_LightShadowBias (high float) 4x1 [-1]
|