Ray Tracing


### for each pixel, shoot ray, intersect with objects, get color from object
```typefor each pixel P	compute ray r	c = shaderay(r)	store c in imgshaderay(r)	(obj, dist) = intersectray(r)	if no obj		return bgshader	n = normal(obj)	return shaded (obj, n)intersectray(r)	obj* = null	dist = Infinity	for each object o		if intersect(o, r) -> t			if t < dist				dist = t				obj = 0	return (obj, dist)```
### Ray Tracing Notion
|Title|
|:-:|
|[deferred ray tracing](https://texonom.com/deferred-ray-tracing-4b34d2c7ee714976b664704deacf5dca)|


- light behind self
- self-shadowing
- objects behind light





