summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shaders/obj.frag.slang8
1 files changed, 4 insertions, 4 deletions
diff --git a/shaders/obj.frag.slang b/shaders/obj.frag.slang
index 30832fb..8feab73 100644
--- a/shaders/obj.frag.slang
+++ b/shaders/obj.frag.slang
@@ -32,12 +32,12 @@ static const float specular_strength = 0.6;
static const float shininess = 32.0;
FSOutput main(FSInput input) {
- float3 light_direction = normalize(float3(-0.45, 0.75, 0.55));
- float3 normal = normalize(input.normal);
- float3 view_direction = normalize(input.camera_position - input.world_position);
+ float3 light_direction = normalize(float3(-0.45, 0.75, 0.55));
+ float3 normal = normalize(input.normal);
+ float3 view_direction = normalize(input.camera_position - input.world_position);
float3 reflect_direction = reflect(-light_direction, normal);
- float diffuse = max(dot(normal, light_direction), 0.0);
+ float diffuse = max(dot(normal, light_direction), 0.0);
float specular = diffuse > 0.0 ? pow(max(dot(view_direction, reflect_direction), 0.0), shininess) : 0.0;
float shade = saturate(ambient_strength + diffuse * diffuse_strength + specular * specular_strength);