This commit is contained in:
2025-02-07 17:04:43 -06:00
parent 33fd7ddf72
commit 8eec81c7f4
2249 changed files with 75331 additions and 685 deletions

View File

@@ -0,0 +1,35 @@
uniform mediump float g_Alpha;
varying vec4 v_ScreenPos;
varying vec4 v_ScreenNorm;
void main() {
gl_FragColor = vec4(0, 0, 0, g_Alpha);
vec3 screenPos = v_ScreenPos.xyz / v_ScreenPos.w;
vec3 screenNorm = normalize(v_ScreenNorm.xyz);
float light = dot(screenNorm, normalize(vec3(0.707, 0.707, 0.707)));
float lightPowd = light;
lightPowd = pow(abs(lightPowd), 2.0) * sign(lightPowd);
light = light * 0.5 + 0.5;
lightPowd = lightPowd * 0.5 + 0.5;
vec3 shadow = vec3(1, 1, 1);
vec3 mid = vec3(1, 0.2, 0);
vec3 high = vec3(0, 0, 1.5);
vec3 res = mix(mix(shadow, mid, smoothstep(0, 0.5, lightPowd)), high, smoothstep(0.5, 1.0, lightPowd));
//gl_FragColor.rgb = screenNorm.rgb * 0.5 + 0.5;
//gl_FragColor.rgb = pow(gl_FragColor.rgb, 2.0);
//gl_FragColor.b = -screenNorm.b;
//gl_FragColor.a *= 0.9;
//light = light * 0.5 + 0.5;
res = vec3(1, 1, 1);
gl_FragColor.rgb = res * pow(light, 0.7);
}

View File

@@ -0,0 +1,17 @@
uniform mat4 g_ModelViewMatrix;
uniform mat4 g_ModelViewProjectionMatrix;
attribute vec3 a_Position;
attribute vec4 a_Color;
varying vec4 v_ScreenPos;
varying vec4 v_ScreenNorm;
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
vec3 normal = normalize(a_Color.rgb * 2.0 - 1.0);
v_ScreenPos = gl_Position;
v_ScreenNorm = mul(vec4(normal, 0.0), g_ModelViewProjectionMatrix);
}