Jump to content

casting photons with Ce variable in PBR


Recommended Posts

I've been playing around with PBR in Houdini 12 and I noticed that if I have a really bright self illuminating surface (or volume), the light contribution from it doesn't show up in the photon map. The end result is that "lighting" a scene this way is a lot grainier than when using standard lights. Is there an easy way to get them to contribute to the photon map or do I need to hack the default photon shader?

-Jon

Link to comment
Share on other sites

I've been playing around with PBR in Houdini 12 and I noticed that if I have a really bright self illuminating surface (or volume), the light contribution from it doesn't show up in the photon map. The end result is that "lighting" a scene this way is a lot grainier than when using standard lights. Is there an easy way to get them to contribute to the photon map or do I need to hack the default photon shader?

-Jon

How about geometry lights? They turn your mesh into a light source which allows to emit photons from it.

skk.

Link to comment
Share on other sites

Alas, it doesn't work with volumes. Even if it did, the emission I tried was limited by a shader to certain areas of the geometry.

How about geometry lights? They turn your mesh into a light source which allows to emit photons from it.

skk.

Link to comment
Share on other sites

Alas, it doesn't work with volumes. Even if it did, the emission I tried was limited by a shader to certain areas of the geometry.

True, it doesn't. Sorry, missed that volume part. I wonder how photons react on smoke collision? Do they stop on entrance or bounce?

Link to comment
Share on other sites

It does look like the volume bsdf gets evaluated in photon bounces; all that is missing is Ce. It does make me suspect all the more that the Ce variable is ignored in the photon shader, and I don't see any reference to it, but I haven't checked "pbr.h" either.

Link to comment
Share on other sites

It does look like the volume bsdf gets evaluated in photon bounces; all that is missing is Ce. It does make me suspect all the more that the Ce variable is ignored in the photon shader, and I don't see any reference to it, but I haven't checked "pbr.h" either.

Indeed, photons respecting volumes is nice additions in H12. Looks like PhotonTracer Shop uses sample_bsdf() equally for volumes. Perhaps this is the spot to mess around with photons :)

Link to comment
Share on other sites

I think I may be going down a rabbit hole... I don't have a really great understanding about how pbr path tracing and photon maps interact.

There is a section inside the default photontracer shop that does a trace() call:

if (trace(tmp, hitI, hitTime,
                                "raystyle", "nolimit",
                                "SID", sid,
                                "samplefilter", "screendoor",
                                "F", hitF,
                                "samplefilter", "closest",
                                "P", hitP, "Ng", hitNg,
                                "Of", hitOf, "dPdz", hitStep))
                        {
                            hitBounces = getbounces(hitF);

                            // If the normal vector has length of 0, this
                            // operation will leave the normal unchanged.
                            // Normals of length 0 identify volume photons
                            // scattered by a volume.
                            hitNg = normalize(hitNg);
                            hitI = hitP - tmp;

                        }

This looks a lot like similar code in the pbr_pathtracer.h file that gets emission from surfaces. So my first stab at getting Ce working was to have that function also sample "Ce", then add it to "cfscale". Well, after this change I do end up with some additional photons that come from my emitted surface, but they are an order of magnitude dimmer than the final traced emission result. And an ugly hack to see if artificially making them as bright as the traced image would smooth the render out didn't have any effect.

So now I wonder if there's a good reason it's not implemented yet...

Or if someone else knows more in technical detail about the way photon tracing and pbr interacts and could offer some patching advice I'd love to hear it.

Indeed, photons respecting volumes is nice additions in H12. Looks like PhotonTracer Shop uses sample_bsdf() equally for volumes. Perhaps this is the spot to mess around with photons :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...