Performance tweaks for renders that include reflective surfaces?

khumak

Engaged Member
Oct 2, 2017
3,623
3,660
I think I finally figured out what seems to cause some of my scenes to either take forever to render or to never finish at all no matter how long I let it render for, reflective surfaces. I can set up a scene that fully renders in 20 minutes in 1 environment, put it in a small room with reflective bathroom tiles/mirrors/whatever at roughly comparable light levels and now that exact same scene can run for more than 8 hours and still have unfinished sections with spots all over it. This happens even with only 1 light source. If I use more than 1 then it's even worse. In an area without reflective surfaces I can use several light sources without my render times getting crazy. The latest scen I'm having this issue with is inside a shower stall so there's basically zero clutter taking up memory, just 3 walls and a shower curtain around the actors.

I suspect the problem is that most of the light sources have infinite range and reflective surfaces effectively turn every light source into multiple light sources bouncing around between surfaces that Daz has to include in it's calculations. If I understand correctly, point lights have a range cutoff beyond which the light source emits zero light which probably explains why scenes where I use point lights to tweak the lighting seem to render faster than if I use spotlights or something. Scenes where the headlamp or some big distant light like the sun is the only light source also seem to render faster.

I haven't figured out a way to get reflective areas to work very well though (other than just turning off reflections entirely). About the only thing I can think of to do is crank up the DOF and just accept a blurry background. I don't have a very good system for rendering (low end CPU, 4GB video card). Are there other tweaks that might help?
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,692
By changing the "Max Path Lenght" parameter in "Render Settings" > "Optimization" you can limit the light path in DAZ.

But going from 20 minutes to 8 hours is a lot... Have you checked that the problem is not that, in the case of 8h renders, DAZ is using the CPU to render instead of the GPU?
 
  • Like
Reactions: khumak

khumak

Engaged Member
Oct 2, 2017
3,623
3,660
By changing the "Max Path Lenght" parameter in "Render Settings" > "Optimization" you can limit the light path in DAZ.

But going from 20 minutes to 8 hours is a lot... Have you checked that the problem is not that, in the case of 8h renders, DAZ is using the CPU to render instead of the GPU?
I end up using the CPU for everything, including the 20 minute renders. I've never been able to get my memory utilization under 4GB. I'm usually in the 8-12GB range for most scenes. I'll look into the Max path length though, thanks. Next time up upgrade, it'll definitely be to a video card with at least 8-12GB of memory but that probably won't be for another few years or so.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,692
8-12GB range? Fuck, what kind of scenes do you set up? LOL

I suppose it's a very big scenario or a lot of characters.
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
I suspect the problem is that most of the light sources have infinite range and reflective surfaces effectively turn every light source into multiple light sources bouncing around between surfaces that Daz has to include in it's calculations.
There's no question that reflective surfaces increase the amount of work that Daz has to do. Think of it this way - choose a pixel on the screen and start throwing photons out at it. If the surface that those photons hit is relatively matte, the photons all get scattered in different direction. Each of those rays now had 1/N the intensity of the original beam. When those rays hit a surface, if it's matte, now the resulting second-bounce rays have 1/N of the first-bounce ones. You can see that pretty quickly, the effect dwindles to near zero. With a highly reflective surface, however, most of the original photons all go off in the same direction, which means that the beam is much closer to the original strength, and so it takes more bounces before it's dwindled down to "ok, we don't care about it any more." That's a rough approximation as to what iRay does, although it's simulating photons coming in the other direction, of course.

If I understand correctly, point lights have a range cutoff beyond which the light source emits zero light which probably explains why scenes where I use point lights to tweak the lighting seem to render faster than if I use spotlights or something. Scenes where the headlamp or some big distant light like the sun is the only light source also seem to render faster.
With a point light, the photons emitted by the light go out in all directions. There's an "n-squared" relationship here - if you're twice as far away, the light has one-quarter the effect. Spotlights, on the other hand, throw the majority of their illumination in one direction. Technically, there's still an n-squared effect, but it effectively drops off more slowly.

I haven't figured out a way to get reflective areas to work very well though (other than just turning off reflections entirely). About the only thing I can think of to do is crank up the DOF and just accept a blurry background. I don't have a very good system for rendering (low end CPU, 4GB video card). Are there other tweaks that might help?
There are a couple of things you can try. First, you can have a surface that's reflective, but not necessarily mirror-like. For most surfaces (if they're using the iRay Uber Shader), there is a "Glossy Roughness" setting. Dialing that up a little bit is kind of like the difference between a polished silver surface and one that's been slightly sandpapered - you'll still get reflective effects, but now there's a bit of diffuseness thrown in. Alternately, you can dial down the "Glossiness" a bit - again, making the surface somewhat less mirror-like.

In addition, as @khumak said, you can cut down on the total number of bounces that iRay will calculate. But, as he also said, the jump in render time is suspicious. Since you only have 4GB of VRAM (and, if you're on Windows, less than that because Windows steals some) it could be that you're teetering right on the hair edge of "GPU or CPU," and somehow the reflective scene is throwing you over the edge. If that's the case, you'd be able to figure it out by looking at the log - you'd see Daz give up on the GPU and flip over to CPU. Best way to handle that is to simplify your scene somewhat. The biggest consumer of VRAM are textures - you can either use something like Scene Optimizer to shrink your textures, change the texture compression settings inside Daz Studio, and/or make sure that things that aren't visible (and don't affect your scene's lighting) are deleted or "turned off" so that they don't occupy VRAM.