diff options
author | pommicket <pommicket@gmail.com> | 2021-09-29 11:38:37 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2021-09-29 11:38:37 -0400 |
commit | 0b9cd314267fb3f654959ed4a33e604b4bfb4fa3 (patch) | |
tree | 0edf99621c19870f5ee5e9275116fc52efb4b1a9 /mainf.glsl | |
parent | 685bc525dec7b5582aee24ca97f6e2d49a25807a (diff) |
new idea: function sandbox
Diffstat (limited to 'mainf.glsl')
-rw-r--r-- | mainf.glsl | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/mainf.glsl b/mainf.glsl deleted file mode 100644 index 7910ab3..0000000 --- a/mainf.glsl +++ /dev/null @@ -1,22 +0,0 @@ -uniform vec4 u_color; -uniform vec3 u_directional_light1; // (direction to light) -uniform vec3 u_directional_light1_color; -uniform vec3 u_directional_light2; -uniform vec3 u_directional_light2_color; -uniform vec3 u_ambient_light; -uniform int u_lighting_enabled; - -varying vec3 normal; - -void main() { - vec3 N = normalize(normal); - vec3 L; - if (u_lighting_enabled != 0) { - L = max(0.0, dot(u_directional_light1, N)) * u_directional_light1_color - + max(0.0, dot(u_directional_light2, N)) * u_directional_light2_color - + u_ambient_light; - } else { - L = vec3(1.0, 1.0, 1.0); - } - gl_FragColor = vec4(L * u_color.xyz, u_color.w); -} |