mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
51 lines
No EOL
1.3 KiB
Text
51 lines
No EOL
1.3 KiB
Text
#version 140
|
||
|
||
uniform float u_time;
|
||
uniform mat4 u_modelViewProj;
|
||
uniform mat4 u_modelView;
|
||
varying vec4 v_color0;
|
||
varying vec3 v_normal;
|
||
varying vec3 v_view;
|
||
varying vec3 v_pos;
|
||
attribute vec3 a_normal;
|
||
attribute vec3 a_position;
|
||
void main ()
|
||
{
|
||
float tmpvar_1;
|
||
tmpvar_1 = ((sin(((a_position.x * 32.0) + (u_time * 4.0))) * 0.5) + 0.5);
|
||
float tmpvar_2;
|
||
tmpvar_2 = ((cos(((a_position.y * 32.0) + (u_time * 4.0))) * 0.5) + 0.5);
|
||
vec3 tmpvar_3;
|
||
tmpvar_3.x = tmpvar_1;
|
||
tmpvar_3.y = tmpvar_2;
|
||
tmpvar_3.z = (tmpvar_1 * tmpvar_2);
|
||
vec3 tmpvar_4;
|
||
tmpvar_4 = ((a_normal * 2.0) - 1.0);
|
||
vec3 tmpvar_5;
|
||
tmpvar_5 = (a_position + ((tmpvar_4 * tmpvar_3) * vec3(0.06, 0.06, 0.06)));
|
||
vec4 tmpvar_6;
|
||
tmpvar_6.w = 1.0;
|
||
tmpvar_6.xyz = tmpvar_5;
|
||
vec4 tmpvar_7;
|
||
tmpvar_7 = (u_modelViewProj * tmpvar_6);
|
||
gl_Position = tmpvar_7;
|
||
v_pos = tmpvar_7.xyz;
|
||
vec4 tmpvar_8;
|
||
tmpvar_8.w = 1.0;
|
||
tmpvar_8.xyz = tmpvar_5;
|
||
v_view = (u_modelView * tmpvar_8).xyz;
|
||
vec4 tmpvar_9;
|
||
tmpvar_9.w = 0.0;
|
||
tmpvar_9.xyz = tmpvar_4;
|
||
v_normal = (u_modelView * tmpvar_9).xyz;
|
||
float tmpvar_10;
|
||
tmpvar_10 = ((sqrt(dot (tmpvar_3, tmpvar_3)) * 0.4) + 0.6);
|
||
vec4 tmpvar_11;
|
||
tmpvar_11.w = 1.0;
|
||
tmpvar_11.x = tmpvar_10;
|
||
tmpvar_11.y = tmpvar_10;
|
||
tmpvar_11.z = tmpvar_10;
|
||
v_color0 = tmpvar_11;
|
||
}
|
||
|
||
|