From 87763fc458c5c25aa74c617a1fb2cac5c09a5f40 Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Sat, 24 Aug 2024 00:08:22 -0700 Subject: [PATCH] Ray-caster: tidy up sphere shading --- app-proto/inversive-display/src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app-proto/inversive-display/src/main.rs b/app-proto/inversive-display/src/main.rs index 1937e2b..d2bc742 100644 --- a/app-proto/inversive-display/src/main.rs +++ b/app-proto/inversive-display/src/main.rs @@ -166,10 +166,9 @@ fn main() { // vector with respect to the coordinates of the impact // point. i calculated it in my head and decided that // the result looked good enough for now - vec3 normal_front = normalize(-v.sp + 2.*v.lt.s*pt); + vec3 normal = normalize(-v.sp + 2.*v.lt.s*pt); - vec3 color; - float incidence = dot(normal_front, light_dir); + float incidence = dot(normal, light_dir); float illum = mix(0.4, 1.0, max(incidence, 0.0)); return taggedFrag(vec4(illum * base_color, opacity), -pt.z); }