bgfx/examples/runtime/shaders/gles/vs_mesh.bin
2012-10-07 20:41:18 -07:00

51 lines
No EOL
1.3 KiB
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifdef GL_ES
precision highp float;
#endif // GL_ES
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;
}