Planetside Software Forums

General => Terragen Discussion => Topic started by: ejgodwin on January 15, 2014, 07:12:25 PM

Title: Halo Effect Rendering Problem
Post by: ejgodwin on January 15, 2014, 07:12:25 PM
Hi,

After reading this post about specks in the atmosphere from a light source:
     http://www.planetside.co.uk/forums/index.php/topic,16690.msg163060.html#msg163060 (http://www.planetside.co.uk/forums/index.php/topic,16690.msg163060.html#msg163060)
I thought I'd try using a small, localized cumulus cloud layer to get a "halo" effect around a torch object & light source. I achieved some fairly decent results:

[attach=1]

The problem is that when I go to do the final render, the progress grinds to a near halt when it reaches the area of the halo. I left it running overnight, and it was still struggling through that one halo. In fact, I couldn't even tell if it had made any progress at all. It blazed through the sky part of the render in no time, so I know it's not just the render settings.

To be fair, the scene is complex, with lots of objects and the sun low on the horizon to the left, not to mention a water shader beneath the bridge. (Wave scale is at 3 to depict a rough mountain river; I did a cropped, lower-quality render with the water shader turned off for the above example.) I also tried setting the water shader transparency to 0, but it didn't seem to have much effect. I'm also not sure the problem's caused by that or even the "atmosphere halo" shader itself, as the immediate area has all those objects (torch, bridge, horse, etc).

I'm kinda stumped, so I thought I'd post the parameters of the atmosphere shader, the light source, and the render itself. Maybe this scene is too ambitious, but I'm hoping some of you more experienced users can spot something out of whack. Basically, I'm looking for the minimum settings to get a nice halo effect like above yet still finish before the next Mayan calender recycles. :D

Low level Cumulus shader settings (only those changed from default):

Main tab:Lighting:Quality tab:Optimization tab:
Light source settings:
Render settings:
Any help is greatly appreciated. Thanks,

Ed
Title: Re: Halo Effect Rendering Problem
Post by: TheBadger on January 16, 2014, 12:16:57 AM
THis light looks very nice already. I hope you find your answers.
Im bookmarking this page as Im sure it will come in handy.

Nice tree spirits in your avatar!
Title: Re: Halo Effect Rendering Problem
Post by: Dune on January 16, 2014, 04:11:20 AM
I'm almost certain it's the water shader that's causing the delay. 3 (three) is very, very rough and even without transparency my experience is that rough water takes ages. Soft shadows isn't helping either, so you could check if you really need that.
Title: Re: Halo Effect Rendering Problem
Post by: Tangled-Universe on January 16, 2014, 04:51:41 AM
Defer Atmo/Cloud only works fast if you REALLY know how to optimize your ratio of atmosphere/cloud quality settings in combination with adaptive AA settings.

I recommend switching that off.

Because, how many atmosphere samples do you use now? Anything beyond 16 atmo samples with AA5 will bogg down your render enormously.
Title: Re: Halo Effect Rendering Problem
Post by: ejgodwin on January 16, 2014, 07:50:02 AM
Ah, I have my Atmosphere samples at 24. I'll try without defer/atmo and see how it goes.

I'd hate to give up on the rough water. I tried a much smoother water setting a while back, but it didn't look natural with it being a mountain stream and all those rocks along the shore.

Thanks for the help.
Title: Re: Halo Effect Rendering Problem
Post by: ejgodwin on January 16, 2014, 09:33:57 PM
Update: I did a cropped render in the problem area so I wouldn't have to spend so much time figuring this out. This is what I found:

Lowered atmosphere samples to 16 and disabled defer/atmo, no luck.

Tried disabling the water shader, but it made no difference.

What did work was disabling the "Ray trace objects" in the render. Went much faster. Looks like the combination of that and those multiple light sources & halos in close proximity are the culprit. But it's not a solution, because the rendered objects looked terrible. I thought of lowering some of the samples in the atmos, etc, and "ray trace everything", but seems to me that would only make things worse.

Open to suggestions at this point.
Title: Re: Halo Effect Rendering Problem
Post by: yossam on January 16, 2014, 09:47:54 PM
Can you post the original tgd........I'll look at it and see if I can figure out what is going on.  :D
Title: Re: Halo Effect Rendering Problem
Post by: ejgodwin on January 16, 2014, 10:46:00 PM
I'd love to. Problem is, the project has huge file dependencies: 2 ter heightfields at 63MB, and another 35MB in imported obj files and supporting texture images. That's too big for an attachment, even zipped. If you can figure out another way to get them to you, I'm more than willing.
Title: Re: Halo Effect Rendering Problem
Post by: Oshyan on January 16, 2014, 10:47:55 PM
It's quite odd that Raytrace Objects is slower, though not unimaginable. Is there anything unusual about your objects? Are they reflective or anything?

- Oshyan
Title: Re: Halo Effect Rendering Problem
Post by: ejgodwin on January 17, 2014, 07:41:03 AM
Most of the shaders for the imported objs/mtls have .333 as reflectivity, which I believe is the default. Should I set those to zero? The horse (and rider, not shown) have a lot of polygons, so I could see where that might slow things down.

To broaden the question, what would be the ideal rendering settings in the specular tab for object shaders?
Title: Re: Halo Effect Rendering Problem
Post by: Tangled-Universe on January 17, 2014, 09:07:24 AM
Quote from: ejgodwin on January 16, 2014, 09:33:57 PM
Update: I did a cropped render in the problem area so I wouldn't have to spend so much time figuring this out. This is what I found:

Lowered atmosphere samples to 16 and disabled defer/atmo, no luck.

Tried disabling the water shader, but it made no difference.

What did work was disabling the "Ray trace objects" in the render. Went much faster. Looks like the combination of that and those multiple light sources & halos in close proximity are the culprit. But it's not a solution, because the rendered objects looked terrible. I thought of lowering some of the samples in the atmos, etc, and "ray trace everything", but seems to me that would only make things worse.

Open to suggestions at this point.

I didn't say that disable deferred atmo would fix your issue and give better results. It only slows down your render, which the second issue you had.

Quote from: ejgodwin on January 17, 2014, 07:41:03 AM
Most of the shaders for the imported objs/mtls have .333 as reflectivity, which I believe is the default. Should I set those to zero? The horse (and rider, not shown) have a lot of polygons, so I could see where that might slow things down.

To broaden the question, what would be the ideal rendering settings in the specular tab for object shaders?

As far as I know it doesn't matter which settings you choose in that tab. It aren't raytraced reflections.
Any reflectivity >0 will have the renderer calculate the incidence of light on the reflective surface and the values set in the specular tab act as a kind of multiplier for the outcome.
Very likely not a correct technical explanation, but in the past 7 years I have never noticed differences in rendertime due to settings in the specular tab of my objects.
Title: Re: Halo Effect Rendering Problem
Post by: Oshyan on January 17, 2014, 12:40:54 PM
Yes, I was referring to *actual* reflectivity (raytraced, using the Reflecting or Water Shaders).

- Oshyan
Title: Re: Halo Effect Rendering Problem
Post by: Matt on January 19, 2014, 05:38:51 PM
"Ray trace objects" affects the speed and quality of not just the objects, but any atmosphere/cloud in front of the pixels of those objects. For every pixel of the object it renders the object's surface and the atmosphere between the object the camera. In terms of sampling and quality, the atmosphere/cloud in front of objects are rendered similarly to "defer atmo/cloud", because it's not possible to generate separate micropolygons just for the atmosphere/cloud floating in front of your objects (micropolygons are the rendering method used to render objects when "ray trace objects" is OFF). Because of all this, you still need to think about optimising your atmosphere and cloud samples if a significant portion of those things covers objects.

Finally, I would recommend leaving "defer atmo/cloud" ON so that you get more consistent quality across the whole image. Personally, my main reason for having "defer atmo/cloud" turned OFF in the default scene is because there are no ray-traced objects in the default scene. As you start to add objects to a large area of the image, to me it makes sense to turn "defer atmo/cloud" ON and try to optimise the cloud and atmosphere samples to that.

Matt
Title: Re: Halo Effect Rendering Problem
Post by: ejgodwin on January 19, 2014, 06:10:59 PM
Makes sense, Matt. I'll give it a try. I'm also reducing the radius of the halo, as it's a tad too generous, IMO.
Title: Re: Halo Effect Rendering Problem
Post by: ejgodwin on January 24, 2014, 01:40:14 PM
Well, after hours of mind-numbing experimentation, it turns out that my problem was none of the above, at least not directly. I had a fake stone shader bordering the river, and when I replaced it with a rock population (thanks to dandelO for his excellent tutorial here: http://www.planetside.co.uk/forums/index.php/topic,10256.msg106284.html#msg106284 (http://www.planetside.co.uk/forums/index.php/topic,10256.msg106284.html#msg106284)), the rendering slowdown problem vanished. For comparison purposes I let the old project render for over 60 hours, and at least 90% of the time was spent on two "rows" beginning in the area of the rock shader, while the render itself was only 2/3 finished (at which point I aborted it). Now it renders overnight. I think it had to do with all the intersections and reflective complexities, both with the water shader and the multiple light sources, as I had the density of the fake rock shader ramped up pretty high.
Title: Re: Halo Effect Rendering Problem
Post by: Dune on January 25, 2014, 03:42:49 AM
Told you so; water and lot of displacement (like in fake stones) is tough.
Title: Re: Halo Effect Rendering Problem
Post by: ejgodwin on January 25, 2014, 08:42:08 AM
Quote from: Dune on January 25, 2014, 03:42:49 AM
Told you so; water and lot of displacement (like in fake stones) is tough.

Not sure where you "told me" -- I've made no changes to the water shader, and I never mentioned the fake stone shader until after your post, and only indirectly with the comment "all those rocks along the shore".

I hope to post the full render soon, as I'd like some input on the halos. They're pretty good, but there's inconsistencies between the four of them. In any case, thanks for everyone's help.
Title: Re: Halo Effect Rendering Problem
Post by: Dune on January 26, 2014, 04:23:37 AM
I was under the impression that you had rough water and (RT) reflections along a coast with a lot of displacement (like with fake stones) will take a long time. But, you're right, I had more assumptions that knowledge.
Title: Re: Halo Effect Rendering Problem
Post by: ejgodwin on January 26, 2014, 07:37:50 AM
Ok, here's the first attempt. It took over 24 hours, but that's because I raised the quality of the halo atmosphere shaders to 1 to get the desired smooth render results. I think I can lower the atmosphere sample setting a little bit next time (currently at 24), or perhaps reduce one of the render node settings like AA or detail by a point. I also reintroduced some transparency to the water shader, which in retrospect was pointless for a low-light render like this.

Any comments on how to improve the quality and/or realism of the render are welcome, but what I can't figure out is why the 4 halos turned out different. The ones on the left have a distinct cutoff to the haze/glow effect, while the ones to the right are pretty close to the effect I'm after, a nice falloff with hardly any detectable margin. I checked all four light sources and halo shaders three times to make sure all the settings were the same. I think it has something to do with the fact that the two on the left are farther away, which might affect how much the density of the localized cloud has on the light source.

You also might notice a strange dark border slanting horizontally through the middle of the render. I'm pretty sure that's due to a shadow effect of the terrain, as the sun is very low on the horizon, 2 degrees. I think I can correct that by raising or lowering the angle just a trifle.