raytracer immer noch kaputt. es war davor kaputt, weil ich im raytracer nicht abgefangen habe wenn der ray nicht trifft. jetzt ist alles schwarz, das weisst auf eine kaputte collision detection hin

This commit is contained in:
any
2026-07-26 18:00:16 +02:00
parent 72d683c1f2
commit b096302738
2 changed files with 1 additions and 0 deletions
+1
View File
@@ -10,6 +10,7 @@ RGBA raytraceSphere(sphere *obj, ray *lightray) {
pixel.a = 1;
vec3 collisionPoint = collisionPointSphere(lightray, obj);
if (collisionPoint.x == -1) {return pixel;}
vec3 sphereNormal = vec3Normalize(vec3Subtract(collisionPoint, obj->origin));
pixel.r = -vec3Product(sphereNormal, lightray->direction);
return pixel;