Jump to content

turn off light for secondary rays


Recommended Posts

Hi,

is there a way to turn off a light for secondary rays only, so it's effect is not visible in reflections or refractions?

cheers

bmt

With a Ray Bounce Level VOP or getraylevel() vex call, you can manage different behavior of your shader for different ray levels. For example, your object's color can be computed in an usual way only for a primary rays (as seen from a camera), and set to something specific for any other ray (reflected/reflacted/irradianced). Use Ray Bounce Level VOP as a switcher (in SwitchVOP) and connect two colors to two inputs of that switch which is turn goes to Cf. See reflections of that object.

hth.

skk.

Link to comment
Share on other sites

Hi,

is there a way to turn off a light for secondary rays only, so it's effect is not visible in reflections or refractions?

cheers

bmt

I modified the Oren Nayer VOP to do this. You can specify a separate Light (or no Light) for secondary rays.

The purpose of it was to be able to render arealight AND irradiance AND Blurry Reflections/Refractions simultaneously and as fast as PBR, but in the normal render engines.

The work flow is:

- Reference copy all the lights

- In the copies set the Light Samples to 1 or 2

- Add the suffix "TRACED" to their names (this causes them to automatically exclude from primary rays and include in secondary rays).

What this does is prevent the light samples from exponentially multiplying. Say you have a 128 sample area light and a 64 sample blurry reflection. Normally what happens is that for each reflection ray it samples the light 128 times, which means the light gets sampled 8192 times! This is why Micropolygon and Raytrace renderers CRAWL compared to PBR.

By setting the area light to 2 samples in secondary rays you kind of mimic PBR's sampling strategy... so 64*2=128, which is the number of samples you originally intended for the light.

I've based our Ubershader around this and the result is same as or better than PBR performance in a given amount of time, but its a pita coz the extra setup means more opportunity for user error.

SideFX could/should? add a "secondary ray samples" render property to the area lights... so we wouldn't have to use shader hackery to get good performance in the standard renderers.

hope this helps

Serg

AXIS_OrenNayer.otl

Edited by Serg
Link to comment
Share on other sites

Thanks for the info and the asset Serg!

I modified the Oren Nayer VOP to do this. You can specify a separate Light (or no Light) for secondary rays.

The purpose of it was to be able to render arealight AND irradiance AND Blurry Reflections/Refractions simultaneously and as fast as PBR, but in the normal render engines.

Edited by brianburke
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...