diff options
author | github-classroom[bot] <66690702+github-classroom[bot]@users.noreply.github.com> | 2024-03-19 02:01:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-19 02:01:17 +0000 |
commit | 0f8d0e3cfdbd9b11b2357ed3e1a11375e7af8e80 (patch) | |
tree | 48b88b3b3b3a522a90c38b2178363a163a32f2ee /resources/shaders/shader.frag |
Initial commit
Diffstat (limited to 'resources/shaders/shader.frag')
-rwxr-xr-x | resources/shaders/shader.frag | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/resources/shaders/shader.frag b/resources/shaders/shader.frag new file mode 100755 index 0000000..de063c2 --- /dev/null +++ b/resources/shaders/shader.frag @@ -0,0 +1,18 @@ +#version 330 core +out vec4 fragColor; + +in vec3 normal_cameraSpace; + +uniform int wire = 0; +uniform float red = 1.0; +uniform float green = 1.0; +uniform float blue = 1.0; +uniform float alpha = 1.0; + +void main() { + // Do lighting in camera space + vec3 lightDir = normalize(vec3(0, 0.5, 1)); + float c = clamp(dot(normal_cameraSpace, lightDir), 0, 1); + + fragColor = vec4(red * c, green * c, blue * c, 1); +} |