summaryrefslogtreecommitdiff
path: root/advanced_lighting/blinn_phong/shaders/blinn_phong.fs
diff options
context:
space:
mode:
authorpryazha <pryadeiniv@mail.ru>2025-02-06 12:38:09 +0500
committerpryazha <pryadeiniv@mail.ru>2025-02-06 12:38:09 +0500
commit926cbd0d49890772f911e6a6bedb7835605ced89 (patch)
treeea27e2c84e32ab6d8d29af9e61cd432e30a46bc6 /advanced_lighting/blinn_phong/shaders/blinn_phong.fs
parentbf1c59565096ac9774493846cfb15e259d3b0e66 (diff)
change
Diffstat (limited to 'advanced_lighting/blinn_phong/shaders/blinn_phong.fs')
-rw-r--r--advanced_lighting/blinn_phong/shaders/blinn_phong.fs62
1 files changed, 0 insertions, 62 deletions
diff --git a/advanced_lighting/blinn_phong/shaders/blinn_phong.fs b/advanced_lighting/blinn_phong/shaders/blinn_phong.fs
deleted file mode 100644
index 23e2968..0000000
--- a/advanced_lighting/blinn_phong/shaders/blinn_phong.fs
+++ /dev/null
@@ -1,62 +0,0 @@
-#version 330 core
-
-in vec2 tex_coords;
-in vec3 normal;
-in vec3 frag_pos;
-
-out vec4 frag_color;
-
-uniform sampler2D texture_diffuse;
-uniform sampler2D texture_specular;
-
-uniform vec3 light_pos;
-uniform vec3 view_pos;
-
-uniform float ambient_strength;
-uniform float specular_strength;
-uniform float shininess;
-
-vec4
-spotlight(vec3 light_dir, vec3 view_dir)
-{
- vec3 tex_color_diff = texture(texture_diffuse, tex_coords);
- float ambient_strength = 0.1f;
- vec4 ambient = tex_color_diff*ambient_strength;
- vec4 diffuse = tex_color_diff*dot(-light_dir, )
- return(color);
-}
-
-vec4
-blinn_phong()
-{
- // Sample the diffuse color from the texture
- vec3 diffuse_color = texture(texture_diffuse, tex_coords).rgb;
-
- // Sample the specular color from the texture (if available)
- vec3 specular_color = texture(texture_specular, tex_coords).rgb;
-
- // Ambient lighting
- vec3 ambient = ambient_strength*diffuse_color;
-
- // Diffuse lighting
- vec3 norm = normalize(normal);
- vec3 light_dir = normalize(light_pos-frag_pos);
- float diff = max(dot(norm, light_dir), 0.0);
- vec3 diffuse = diff * diffuse_color;
-
- // Specular lighting
- vec3 view_dir = normalize(view_pos-frag_pos);
- vec3 halfway_dir = normalize(light_dir+view_dir); // Halfway vector
- float spec = pow(max(dot(norm, halfway_dir), 0.0), shininess);
- vec3 specular = specular_strength*spec*specular_color;
-
- // Combine all components
- vec3 result = (ambient+diffuse+specular);
- return((result, 1.0));
-}
-
-void
-main(void)
-{
- frag_color = blinn_phong();
-}