Jump to content

PBR snack


Recommended Posts

Howdy. I just did a class at SESI LA on PBR. Much of the material overlapped with stuff that's already out there, but there were a few extra things that might be of use that I'd like to share.

The class started with a discussion of what pathtracing is, how its different than other rendering algorithms, and why its useful. We went on to look at the basics of using PBR as compared to Micropoly or Raytrace Mantra, then we talked about some of the new PBR stuff for H10.

PBR Chart

post-4364-124985657608_thumb.jpg

This was something I hoped people would take with them as reference for the important PBR parameters.

Using ray variance antialiasing (controlled by the Min Ray Samples parameter) for shading antialiasing, and pixel samples for geometry sampling antialiasing was discussed. The behavior of the Min Reflection Ratio and Color Limit parameters was also checked out.

I also tried to use this chart to show how linearly PBR responds to changing these parameters. There is a very linear relationship between how many primary rays you fire and how long your render takes. This is a really nice property of pathtracers like PBR.

Shot

pbr_matte.jpg

This scene is very privative, but I think it does a good job of showing how PBR can be used in a cg+live plate setting. It also shows the capability of PBR to render out AOVs by splitting out direct and indirect light and rebuilding the beauty in the comp.

This setup also shows how we can do something fairly subtle but handy - casting shadows and bouncing indirect light onto the plate from cg objects. It is often good enough to render a shadow pass in the Micropoly or Raytrace engine with a VEX Shadow Matte material, but if bouncing or emitting light off the cg object onto the plate is necessary - this is the way to go. To achieve this, we render a diffuse surface representing the surface receiving shadows with phantom shading enabled for our cg object. In this pass, we also export the unshadowed diffuse shading as an AOV (by checking on the "generate surface shader exports" parameter to do the shading in the raytrace engine). In the comp, we can divide the two to disassociate the shadows and bounces from the diffuse shading. This is also how the VEX Shadow Matte material works internally.

shot.zip

BSDF VOP

bsdfs.jpg

The next thing we did was make our own BSDF VOP - in this case a phonglobe (my most often used BSDF). The phonglobe is particularly useful because it can take an arbitrary vector as its direction input. We used the phonglobe() function to generate a bsdf, and also used the albedo() function to find a normalizing factor. Normalizing glossy BSDFs can be important, because their albedos can change quite dramatically when you adjust their parameters.

The docs provide a great overview of the privative BSDF types that are available in PBR.

bb_phonglobe.otl

Messing with the VEX Pathtracer Shader

example.jpg

This example starts with showing how we can do emission in PBR by exporting a color as Ce - which we did for the sky shader and the fake atmosphere on the ground shader. In this case, it would make more sense to use the environment area light, but the sky is geometry in this case because of the caching example.

The last thing we did in the class was mess with the VEX Pathtracer Shader which - along with the pbr.h header it calls - is the VEX implementation of the PBR engine. In the class we just added some modifiers to turn up and down the various lighting components, but the goal was to show that we can do whatever we want to this shader (which is totally cool).

The linked asset is a simple modification of the PBR shader that tries to emulate the behavior of Mental Ray's Final Gather - decoupling indirect and direct shading quality and resolution through a two passed approach.

Exchange Asset - VEX Pathcache

Some of this stuff came from trial and error and stuff, so I'd love to hear of other approaches to things like casting shadows and emitting onto plates, tweaking BSDFs, caching PBR, or antialiasing strategies. I'd also be very interested to see what other modifications people might have made to the VEX Pathtracer shader, as there's massive potential do to cool hacks and additions here.

Hopefully some of this stuff is at all useful to you. Thanks for checking it out. Also big thanks to SESI for making Mantra PBR totally awesome.

Edited by brianburke
  • Like 9
Link to comment
Share on other sites

  • 1 month later...

So, the Mantra Help card is wrong I take it? It says that Pixel Samples are used for everything if PBR/Raytracing engines are used...

I'm testing this and it certainly seems like things are separate...

Awesome you put this up, I have learned a lot :)

Cheers,

Peter B

Link to comment
Share on other sites

For what it's worth, it seems like the post rating system is broken. I just tried to give this a positive rating, and got an error stating that I have used my quota of positive ratings for the day. This being the first time I've attempted to give a rating.

That said Brian... you have my positive rating in spirit. :ph34r:

Link to comment
Share on other sites

So, the Mantra Help card is wrong I take it? It says that Pixel Samples are used for everything if PBR/Raytracing engines are used...

I'm testing this and it certainly seems like things are separate...

The help card reflects the behaviour in Mantra9.0/9.5. The separation of pixel and ray samples in the raytrace engines was introduced with H10. Saves a ton of time and memory, and the fact that ray samples can be set per-object makes it all the more awesome.

EDIT: forgot to thank Brian for all the hard work, so thanks, Brian! Great to see this stuff come together.

cheers,

Abdelkareem

Edited by anamous
Link to comment
Share on other sites

  • 2 months later...

For what it's worth, it seems like the post rating system is broken. I just tried to give this a positive rating, and got an error stating that I have used my quota of positive ratings for the day. This being the first time I've attempted to give a rating.

That said Brian... you have my positive rating in spirit. :ph34r:

A bit late, but this is fixed now.

M

Link to comment
Share on other sites

Just a quick question: Where can you set the color limit? I see it in the first image but cant find it in the PBR render tab :(

Like in case of many Mantra render properties you have to add it to your node from a list of available properties. Checkout Gear icon at a top of parameter pane of Mantra ROP -> Edit Rendering Parameters.

Link to comment
Share on other sites

Like in case of many Mantra render properties you have to add it to your node from a list of available properties. Checkout Gear icon at a top of parameter pane of Mantra ROP -> Edit Rendering Parameters.

Ahhh thanks! Found it :), are there other parameters that are usefull? Or are there to just to many? ;)

Link to comment
Share on other sites

  • 2 months later...

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...