Hacker News new | past | comments | ask | show | jobs | submit login
Casual Shadertoy Path Tracing 2: Image Improvement and Glossy Reflections (demofox.org)
71 points by Impossible on June 7, 2020 | hide | past | favorite | 15 comments




On the subject of the blue and magenta ball- I’ve seen materials that look like that in the real world, it was a specially coated mirror, I can’t remember what we used it for, but we were doing laser based imaging of live cells. If you held the mirror at the right angle you could see that the light transmitted was one color and the light reflected was another color.

Update: it’s called a dichroic mirror: https://en.m.wikipedia.org/wiki/Dichroic_filter


part 1: https://blog.demofox.org/2020/05/25/casual-shadertoy-path-tr...

You started part 1 with:

> When you see a photorealistic image that someone says is “ray traced” what they likely mean is that it is “path traced” ...

well, you just became my new hero. Thank you for saying what is my pet peeve ever since nVidia started using the term ray tracing for some stupid reason that I will never understand.


Let me help you understand the reason, and why it’s not stupid.

NVIDIA’s RTX hardware provides only ray tracing capability. User software is required to add any path tracing, and path tracing is always built using ray tracing, whether you use RTX or not. The choice to use “ray tracing” when referring to RTX is deliberate and accurate. Calling it “path tracing” would be wrong and misleading. But it’s perfectly fine, and encouraged, to use RTX to make path tracing renderers and games.

“Ray tracing” has overloaded meanings. It means any time you literally trace a ray to test the visibility between two points (which path tracing does) and it also, depending on context, refers to Turner Whitted’s recursive shading model, and/or a ray tracing renderer that forks a ray path at reflection & refraction events.

“Path Tracing” also has overloaded meaning, and it tends to most commonly refer to the more vague meaning of any time you do global illumination using ray tracing. The more precise meaning of the term is referring to using a single high dimensional number, one that represents a connected path of rays, as a single sample in the space of the rendering equation. It’s a way of thinking about integration of the rendering equation that is analogous to what an individual photon does.

The strict form of path tracing is a single path that connects the camera or your eye to a light source. Almost nobody actually does that, because it’s more efficient to do direct lighting, or “next event estimation” at each bounce along a path.

So, “path tracing” is almost always used now in the more hand-wavy meaning that indicates there’s some global illumination. “Ray tracing” can also mean tracing rays on the way to global illumination. There is no distinct or hard line between these terms, but a good rule of thumb is if you’re doing global illumination, use “path tracing”, and if you’re testing visibility between points with a ray for any other reason, or referring to the mechanics of tracing one segment of a longer path, then use “ray tracing”.


It seems that a lot of the current games with real-time ray tracing do not actually do path tracing, they only use ray tracing for shadows and (single-bounce) reflections. Even that UE5 demo doesn't seem to do path tracing, it looks like at best they're ray tracing for iterative updates of global illumination (though that's a guess, I haven't been following that too closely). So Nvidia's use of terminology is largely correct.

Of course, the long-term goal is to have real-time path tracing, but that does seem to be a ways off still.


The UE5 demo doesn't use GPU raytracing hardware and doesn't raytraced triangles. They use a combination of voxels, signed distance fields.

Raytracing accurately describes GPU hardware, it's not a fixed function path tracer, although you can use it to implement a path tracer (Quake 2 RTX for example). Developers talk about using it for non-graphics use cases like physics, AI and audio even.


I would assume that's because the hardware they provide is for calculating the triangle-ray intersection.

You can use that for path tracing, but not only.


Isn't path tracing a subset of ray tracing?


Part 1 even says

> Path tracing is a type of ray tracing

contradicting itself.


This isn’t actually a contradiction unless you misunderstood one of the two sentences. Try assuming both statements are true at the same time, and then think about what that implies.


I would see it’s the other way around. A path is definitely a more generic term than a ray.


However paths are made out of rays. So the basic technology implemented on the GPU is to calculate intersections or rays against geometry, raytracing, which is the basic building block of path tracing and several other classes of algorithms.


Yes, maybe for the individual English words "path" and "ray", but as a graphics term, path tracing is a subset of a larger area called ray tracing. There are many, many different forms and algorithms for ray tracing, and path tracing is one of those.


Funny when I was learning raytracing, I thought it was going to look real fancy, but ended up with graphics no different to what I was already doing in basic opengl, except for the reflections and shadows.


Oh, I loved the first article, super happy there is a follow-up !




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: