bgfx/examples/runtime/shaders/gles/vs_mesh.bin
2012-10-27 21:34:41 -07:00

53 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_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;
}