mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
49 lines
1.2 KiB
Text
49 lines
1.2 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_position + ((a_normal * tmpvar_3) * vec3(0.06, 0.06, 0.06)));
|
|||
|
vec4 tmpvar_5;
|
|||
|
tmpvar_5.w = 1.0;
|
|||
|
tmpvar_5.xyz = tmpvar_4;
|
|||
|
vec4 tmpvar_6;
|
|||
|
tmpvar_6 = (u_modelViewProj * tmpvar_5);
|
|||
|
gl_Position = tmpvar_6;
|
|||
|
v_pos = tmpvar_6.xyz;
|
|||
|
vec4 tmpvar_7;
|
|||
|
tmpvar_7.w = 1.0;
|
|||
|
tmpvar_7.xyz = tmpvar_4;
|
|||
|
v_view = (u_modelView * tmpvar_7).xyz;
|
|||
|
vec4 tmpvar_8;
|
|||
|
tmpvar_8.w = 0.0;
|
|||
|
tmpvar_8.xyz = a_normal;
|
|||
|
v_normal = (u_modelView * tmpvar_8).xyz;
|
|||
|
float tmpvar_9;
|
|||
|
tmpvar_9 = ((sqrt(dot (tmpvar_3, tmpvar_3)) * 0.4) + 0.6);
|
|||
|
vec4 tmpvar_10;
|
|||
|
tmpvar_10.w = 1.0;
|
|||
|
tmpvar_10.x = tmpvar_9;
|
|||
|
tmpvar_10.y = tmpvar_9;
|
|||
|
tmpvar_10.z = tmpvar_9;
|
|||
|
v_color0 = tmpvar_10;
|
|||
|
}
|
|||
|
|
|||
|
|