tsoding / ray-tracer

My ongoing effort to learn how to make Ray Tracers
MIT License
15 stars 2 forks source link

Path tracing #34

Open w23 opened 6 years ago

w23 commented 6 years ago

Pretty pictures easy (and slow. veeeeery slooooow)

rexim commented 6 years ago

@w23 isn't this a duplicate of #14?

w23 commented 6 years ago

It depends on what you meant by Ray Tracing there ;). "Ray tracing" usually means just this: the geometry is rasterized using some form of ray-geometry intersection tests, as opposed to more common triangle rasterization, where you project each triangle onto screen at once and fill its pixels. It doesn't say anything about pixel colors, lighting, textures, etc.

There are several ways to do ray-intersection tests, for example:

w23 commented 6 years ago

Path tracing is more about lighting. It's a method to calculate lighting and global illumination (a holy grail in computer graphics) by bouncing the ray around a lot. You can use any intersection test for it (although, in reality, i've only been able to do realtime path tracing for very simple scenes of a few analytical spheres and planes).

saidm00 commented 6 years ago

I'm in favor of this :D

saidm00 commented 6 years ago

Yeah ray marching or sphere tracing gets annoying when you offset a shape and get non exact distances. Also you have to handle overstepping when you optimize and a lot of other problems. The regular algorithm is slow, etc... Path traced analytic solution is the best imo for offline rendering. For realtime sphere tracing with simple lighting is much more flexible and performant. Check out Mirror Drop game ;).