Jump to content

Environmentlights + Reflections = Slow (I know)


Recommended Posts

Hi,

I'm using a environment light and some glossy surfaces. Rendertimes go up. The samples of the environment light start to get interessting at 64, but I'm looking for some ways to speed that up.

I guess the problem is that every glossy sample causes all the lightsamples. but I think in the reflection i don't need that much detail, just somthing similar in color and brightness. with mental ray I offen use a simpler shading model for the reflective ray only. but how can I do this with mantra and is it possible to get a light sampled different in the refections. is it possible at all?

martin

Link to comment
Share on other sites

Hi,

I'm using a environment light and some glossy surfaces. Rendertimes go up. The samples of the environment light start to get interessting at 64, but I'm looking for some ways to speed that up.

I guess the problem is that every glossy sample causes all the lightsamples. but I think in the reflection i don't need that much detail, just somthing similar in color and brightness. with mental ray I offen use a simpler shading model for the reflective ray only. but how can I do this with mantra and is it possible to get a light sampled different in the refections. is it possible at all?

martin

First to answer your last question: you can edit your shaders either in VOPs or VEX to allow for a simpler shading process for reflection rays. You can get the current ray level (Ray Level VOP or getraylevel()), and if it's larger than 0, return a simple lambert shading or a constant etc.

But to get back to you problem: this sounds like a perfect case for PBR, which usually outperforms the normal MP/raytracing engine when it comes to both environment lights and blurry (I presume you mean blurry) reflections. Have you tried it? If you are using a standard set of shaders in your scene, you can simply switch the engine to PBR and have comparable results.

And as always, use .RAT files and try blurring them quite heavily, that also helps clear up at lower samples.

If you're up for an adventure, you can try outputting a point cloud of your scene, then abusing the pcloud functions as a lookup for your reflections, and using a blur function on the final environment map lookup. I expect this to be really fast, but also non-trivial.

cheers,

Abdelkareem

Link to comment
Share on other sites

I tried PBR and it was faster. The only reason to use Micorpolygon was the missing Extra Image Planes. But when I remember right, You mentionend in another thread that one could use a take setup to split the image into layers, I have to try this one.

the pointcloud approach sounds indeed like a adventure :) , but I must have a lool at it. Thanks so far for Your hints

First to answer your last question: you can edit your shaders either in VOPs or VEX to allow for a simpler shading process for reflection rays. You can get the current ray level (Ray Level VOP or getraylevel()), and if it's larger than 0, return a simple lambert shading or a constant etc.

But to get back to you problem: this sounds like a perfect case for PBR, which usually outperforms the normal MP/raytracing engine when it comes to both environment lights and blurry (I presume you mean blurry) reflections. Have you tried it? If you are using a standard set of shaders in your scene, you can simply switch the engine to PBR and have comparable results.

And as always, use .RAT files and try blurring them quite heavily, that also helps clear up at lower samples.

If you're up for an adventure, you can try outputting a point cloud of your scene, then abusing the pcloud functions as a lookup for your reflections, and using a blur function on the final environment map lookup. I expect this to be really fast, but also non-trivial.

cheers,

Abdelkareem

Link to comment
Share on other sites

Well. You know. You got me thinking. :lol: May I interest you in the following "solution" or more appropriately HACK:

I'm using the irradiance function with a relatively small angle to raytrace and lookup in an environment map. The advantage being that you can actually use the irradiance cache and normal micropoly engine ;). It will not work in every case, and sometimes artifacts will occur (ray bias and so on), but it might be worth a shot for you.

Have a look at this (image rendered in micropoly in under 1 minute).

post-1116-1233350181_thumb.jpg

cheers,

Abdelkareem

cheap_ugly_reflections.hip.zip

Link to comment
Share on other sites

Very interesting! Thanks a lot for this example :)

Well. You know. You got me thinking. :lol: May I interest you in the following "solution" or more appropriately HACK:

I'm using the irradiance function with a relatively small angle to raytrace and lookup in an environment map. The advantage being that you can actually use the irradiance cache and normal micropoly engine ;). It will not work in every case, and sometimes artifacts will occur (ray bias and so on), but it might be worth a shot for you.

Have a look at this (image rendered in micropoly in under 1 minute).

post-1116-1233350181_thumb.jpg

cheers,

Abdelkareem

Link to comment
Share on other sites

Strange, this file is giving me a "singular matrix" error on one of the spheres and its not being sent to the ifd. I tested with a couple of more recent builds, looks like some kind of bug. This is with apprenticeHD on xp64.

Link to comment
Share on other sites

Strange, this file is giving me a "singular matrix" error on one of the spheres and its not being sent to the ifd. I tested with a couple of more recent builds, looks like some kind of bug. This is with apprenticeHD on xp64.

i don't think you can output ifd on apprenticeHD.

Link to comment
Share on other sites

no ifd gets written on disk, but it happens when houdini try's to render. I first ignored this, but I get this on xp64 and xp32. I used the code of the shader in a new scene, and it worked fine.

@Abdelkareem:

There is no way to distinguish a reflective ray from a refractive one in the shading context?

i don't think you can output ifd on apprenticeHD.
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...