Cycles_path_guiding tests

good to know that it finally works for you :wink:

1 Like

I’m not getting this to work with glossy shader or principled with metallic =1.
Rendering in a cube with glossy wall material, indirect lighting with spotlight 4° aimed at the wall.
Renders with PG on and PG off are identical.

Diffuse works and principled shader with metallic=0, the three directional sampling types don’t show much difference though.

could you share the scene?

Yup, here:
PGtest1.blend.7z (370.5 KB)
Tested on MacBook Air M1 MacOS 13.2

1 Like

THX, I will have a look at it.

1 Like

I downloaded the file and did some testing - there were a few settings turned off (like deterministic), but even after turning them on again, I too could see very little difference between the three PG modes. The odd pixel here and there.

I changed the settings of this project to my usual settings. It is observed that the noise of PG is almost indistinguishable from the plain path tracing. This means that PG has no effect in this scene, just like when there was only the Diffuse Product method before, PG had no effect on the surface with a brightness of 0.
Reference image for this project rendered with Luxcore, 16 minutes, BPT:

1 Like

I modified a little @moony 's scene and RIS looks really promising:

Raw path tracing


Diffuse-based PG

RIS PG

Roughness-based PG

10 Likes

What I am interested in is knowing just what kind of material is needed for the RIS algorithm to really cause a benefit. It has become obvious from my tests that in spite of what the build is advertised as (path guiding for glossy surfaces), it does not seem to make a different in cases like small highlights (which still requires a ton of samples which fortunately is possible with the help of adaptive sampling).

I mean, a highlight is obviously something you would get with a glossy surface, so why are they still so tricky to render?

4 Likes

This is the only scene I have found where RIS and Roughness based path guiding really make a huge difference. We need to understand why it works so well in this scene, whereas with others it’s marginal at best.

The one thing my scene does have that others don’t appear to have is that the vast majority of light in my scene is coming through a refractive glass window. In effect - pretty much all the of the light in this scene is either a direct caustic, or a bounce from a caustic. There is a very small amount of indirect light coming from the front via a point light that is round the corner - but it’s contribution is minimal.

So have I just happened upon the best case scenario for these algorithms by accident?

4 Likes

Here is a new test - a variation on the theme if you will.

Here there are two lights in the scene - one completely inside a glass sphere (simulating a tiffany lamp type effect), and another behind the camera which itself is behind a diffuse plane (so only providing bounce light). The room itself also has a diffuse material.

The ‘tiffany’ lamp is providing most of the light, with the bounce light just being used as a dim fill light. Monkey has a rough glossy material.

No PG

Diffuse PG

RIS

As you can see - RIS again comes out on top.

It appears RIS works well when glossy materials are receiving caustics or light that has passed through a refractive medium first. This is consistent behaviour with my previous scene - the rough glossy material is much cleaner with RIS enabled.

5 Likes

Not wanting to clutter up this test thread, but does any other renderer have this? It is honestly insane how much PG helps. Watch out “insert all renderers”

I have found another scenario where RIS clearly wins.

In this case I removed the tiffany lamp and created a curved glossy reflector with a roughness of 0.1. I also changed the room material from a diffuse to a rough glossy (roughness 0.5). The previous bounce light was left the same. The monkey receives no direct illumination, all of it’s illumination coming indirectly via glossy bounces.

No PG

Diffuse PG

RIS

9 Likes

Another test - as above - but chucked a couple of objects with diffuse materials in. The result, more illumination on the glossy back wall via bounce light off the diffuse objects, but also a lot more noise and significantly more fireflies. RIS still wins, but adding diffuse materials seems hamper RIS somewhat.

Is it possible that the guiding for diffuse and glossy rays are competing or not playing well together?

No PG

Diffuse PG

RIS

One other thought - do we actually need to rethink diffuse vs glossy materials altogether?

Aren’t most solid diffuse materials actually just rough glossy materials when it comes down to it (as evidenced by the fact that you can polish most materials to a shine). Are there any actual truly diffuse materials in nature - or should we think of all materials in terms of them being glossy…just with varying degrees of roughness?

Basically depends on scale.
If you look very closely, just about anything is reflective, and transmissive, and refractive. Even very dark stuff, if you only have like a one atom or molecule thick layer of it, it’s not actually gonna look dark that dark. (Also, at those scales, thin film effects will play a role)

Something that’s extremely diffuse is your typical pile of dust. Every piece of it already is fairly diffuse to begin with, and then it’s ultra porous, meaning you end up with pretty substantial scattering effects that aren’t quite like your regular sub surface scattering, as this is actually light bounding around wildly on the extremely large surface of the object, rather than necessarily passing through said object.

Basically, shading happens on (at least) three scales:

  • macroscale, defined by your geometry
  • mesoscale, defined by your surface normals
  • microscale, defined by your specific shader.

(there are models that include further scales, in particular for the sake of thin film effects and such)

At very high roughness levels, it’s best to use a light weight diffuse shader of some sort. At lower roughness, you’ll need some glossy shader. The thing is, doing extreme roughness glossy shaders is actually tricky to do efficiently and correctly. Diffuse shaders are a great shortcut where light is generally assumed to bounce in any direction with basically equal probability (details vary depending on the precise shader) no matter what the incoming light direction was. It’s a great approximation, but yes, it’s not perfect.
Still, if you rely on a highly rough glossy shader, that turns out to actually be less correct most of the time. The current GGX loses energy (highly rough surfaces look darker than they ought to) and Multiscatter GGX appears to be a buggy, complicated mess that is being abandonned. It’s also relatively slow.

That’ll be a shame actually - since there is no way to simulate high roughness glass without it. Normal GGX glass with high roughness is far too dark. For opaque materials we have the diffuse shader to fall back on if we want a high roughness look - but for glass, we don’t have a high roughness equivalent. Probably a subject for another thread though.

Improvement to roughness handling in GGX is being worked on by Lukas Stockner in Principled BSDF v2.

1 Like

@moony the feature of multiscatter GGX will stay but only the way it is implemented will change.
It might will be just a flag on the glossy shaders to enable disable multi-scatter :slight_smile:

As I understood it, it won’t literally be the same method though, right? Something about a different way to ensure energy conservation? I’m not entirely sure though

1 Like

When the roughness of the metal surface is about 0.45, the PG stops working. Is this normal?Just like in the @epilectrolytics’ scene

1 Like