mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
33 lines
No EOL
1.2 KiB
Text
33 lines
No EOL
1.2 KiB
Text
#version 140
|
||
|
||
uniform float u_time;
|
||
varying vec4 v_color0;
|
||
varying vec3 v_normal;
|
||
varying vec3 v_view;
|
||
varying vec3 v_pos;
|
||
void main ()
|
||
{
|
||
vec3 tmpvar_1;
|
||
tmpvar_1 = normalize(v_normal);
|
||
float tmpvar_2;
|
||
tmpvar_2 = dot (tmpvar_1, vec3(0.0, 0.0, -1.0));
|
||
vec2 tmpvar_3;
|
||
tmpvar_3.x = tmpvar_2;
|
||
tmpvar_3.y = dot ((vec3(0.0, 0.0, -1.0) - ((2.0 * tmpvar_2) * tmpvar_1)), normalize(v_view));
|
||
float tmpvar_4;
|
||
tmpvar_4 = max (0.0, tmpvar_2);
|
||
vec4 tmpvar_5;
|
||
tmpvar_5.xw = vec2(1.0, 1.0);
|
||
tmpvar_5.y = tmpvar_4;
|
||
tmpvar_5.z = (float((tmpvar_2 >= 0.0)) * max (0.0, tmpvar_3.y));
|
||
float tmpvar_6;
|
||
tmpvar_6 = (((((sin(((v_pos.x * 3.0) + u_time)) * 0.3) + 0.7) + ((cos(((v_pos.y * 3.0) + u_time)) * 0.4) + 0.6)) + ((cos(((v_pos.z * 3.0) + u_time)) * 0.2) + 0.8)) * 3.14159);
|
||
vec3 tmpvar_7;
|
||
tmpvar_7.x = ((sin((tmpvar_6 * 8.0)) * 0.4) + 0.6);
|
||
tmpvar_7.y = ((sin((tmpvar_6 * 4.0)) * 0.4) + 0.6);
|
||
tmpvar_7.z = ((sin((tmpvar_6 * 2.0)) * 0.4) + 0.6);
|
||
gl_FragColor.xyz = pow (((vec3(0.07, 0.06, 0.08) + ((tmpvar_7 * v_color0.xyz) * tmpvar_4)) + (max ((0.2 + (0.8 * pow ((1.0 - tmpvar_2), 5.0))), 0.0) * pow (tmpvar_5.z, 128.0))), vec3(0.454545, 0.454545, 0.454545));
|
||
gl_FragColor.w = 1.0;
|
||
}
|
||
|
||
|