summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-05-23 18:50:54 +0200
committerHampusM <hampus@hampusmat.com>2024-05-23 18:51:08 +0200
commit6d53e3b175fbaf379ef8400cdd1efeb725cf4ecd (patch)
treecbe64ff01e59e3dc9a9cfd8aa2457527d7521ad7
parente9504a3b90ef081dcd622381694f6c51e2844c2d (diff)
style(engine): fix whitespace in shaders
-rw-r--r--engine/light.glsl31
-rw-r--r--engine/vertex.glsl2
2 files changed, 16 insertions, 17 deletions
diff --git a/engine/light.glsl b/engine/light.glsl
index 7516a58..6bc730a 100644
--- a/engine/light.glsl
+++ b/engine/light.glsl
@@ -4,23 +4,23 @@
#define LIGHT_GLSL
struct Material {
- vec3 ambient;
- vec3 diffuse;
- vec3 specular;
- sampler2D ambient_map;
- sampler2D diffuse_map;
- sampler2D specular_map;
- float shininess;
-};
+ vec3 ambient;
+ vec3 diffuse;
+ vec3 specular;
+ sampler2D ambient_map;
+ sampler2D diffuse_map;
+ sampler2D specular_map;
+ float shininess;
+};
struct PointLight {
vec3 position;
- vec3 diffuse;
- vec3 specular;
- float constant;
- float linear;
- float quadratic;
-};
+ vec3 diffuse;
+ vec3 specular;
+ float constant;
+ float linear;
+ float quadratic;
+};
vec3 calc_ambient_light(in Material material, in vec2 texture_coords)
{
@@ -55,7 +55,7 @@ vec3 calc_specular_light(
vec3 view_direction = normalize(view_pos - frag_pos);
vec3 reflect_direction = reflect(-light_dir, norm);
-
+
float spec =
pow(max(dot(view_direction, reflect_direction), 0.0), material.shininess);
@@ -111,5 +111,4 @@ vec3 calc_point_light(
return diffuse_light + specular_light;
}
-
#endif
diff --git a/engine/vertex.glsl b/engine/vertex.glsl
index ac24ef2..f282864 100644
--- a/engine/vertex.glsl
+++ b/engine/vertex.glsl
@@ -13,7 +13,7 @@ uniform mat4 projection;
void main()
{
- gl_Position = projection * view * model * vec4(pos, 1.0);
+ gl_Position = projection * view * model * vec4(pos, 1.0);
in_frag_pos = vec3(model * vec4(pos, 1.0));
in_texture_coords = texture_coords;