Planetside Software Forums

General => Terragen Discussion => Topic started by: digitalguru on October 23, 2024, 05:15:16 AM

Title: population madness
Post by: digitalguru on October 23, 2024, 05:15:16 AM
Just about to launch into a scene of a forest I'm planning to to render in TG. I have lots of assets to add, PlantFactory trees (great find now it's free) and lots of meshes for ground cover (twigs, leaves, mosses etc). I want enough variation for realism, so I'm thinking 3 or 4 variations of trees, and all other elements. How well does TGD handle many populations? What's the maximum number of populations anybody has had in a scene? (and ram usage?)

I'm looking at Dune's work as I'm writing this, some great renders with a lot of nice variation in the vegetation - wondering how many population you had in scene and how manageable it was?
Title: Re: population madness
Post by: Dune on October 23, 2024, 07:34:04 AM
I'm looking forward to see your work on this. I usually have about 50-20 or so pops of grasses and trees. But they are my own, with not extremely heavy textures or vertex count. Especially for more distant stuff in large coverage, I tend to use lowpoly trees, or the internal grass. Precise location of front, heavy stuff, so nothing is 'wasted' behind the camera.
RAM usage usually under 20 gigs. But I don't know what happens if you plant 'Factory' trees in big pops ...
Title: Re: population madness
Post by: digitalguru on October 23, 2024, 07:56:39 AM
Thanks Dune! 50 or so populations, thought you might have said less, so that's encouraging..

Shot is animated with the camera panning left to right and close to the ground, so layering levels of detail f.g. to b.g will help. I'm starting with 4k textures (esp. for pops with fine detail like moss) so will see how that goes memory wise.

Since the shot is quite close to the ground, having a good variation of plants will be essential, but for extreme close up flora, I'll probably render in Maya and comp it over.
Title: Re: population madness
Post by: Dune on October 23, 2024, 08:20:30 AM
Oops, typo! I meant 10-20 pops :-[
But if the shot is close to ground, you won't need an extensive field of hires veggies, just keep it as much to the front as possible, especially with big numbers of pops. Good luck.
Title: Re: population madness
Post by: digitalguru on October 23, 2024, 08:24:20 AM
Quote from: Dune on October 23, 2024, 08:20:30 AMOops, typo! I meant 10-20 pops :-[
LOL - I was just about to go for it...

I'm using image files to texture my terrain (looks good) and my render hits 12gb with out any populations, so will see how that goes. At least I've got 96gb of ram to play with....
Title: Re: population madness
Post by: Dune on October 24, 2024, 01:25:52 AM
96 gigs ... nothing to worry about then, I'd say.
Title: Re: population madness
Post by: digitalguru on October 24, 2024, 05:54:20 AM
Testing population renders a.t.m and this is the first time I've tried a scene where there is a canopy of trees covering the terrain. First thing I've noticed is while there a sufficient density of trees in my test scene to allow light through, I'm not getting much bounce on the ground, my shadows are still quite black. I've tried path tracing and standard renderer with more cache detail with similar results.

ANybody have any good tips for achieving this in TG? I'm trying to get a nice dappled light coming through the tree canopy.
Title: Re: population madness
Post by: Dune on October 24, 2024, 10:01:17 AM
I also had some trouble getting enough light in dark areas under canopies. One thing I always do is reduce opacity of the leaves, which does have an effect, let's more light through. Not under 0.5000001 of course. With standard you can up the surface GI, which won't work with PT of course. An extra no shadow sun at 0.1 or so high up will probably also get more light in the darks. Or increase exposure, but then sky may get too bright. More clouds may reflect more light in too, I'd say.
Title: Re: population madness
Post by: digitalguru on October 24, 2024, 10:24:40 AM
Thanks Dune, some good tips! Just tried them and, as you say, the leaf opacity make the best contribution. Good it works with the standard renderer, but path tracing also benefits.
Title: Re: population madness
Post by: digitalguru on October 27, 2024, 05:46:20 PM
just made some initial tests using your suggestions for lighting (but only one population in this one :) ) - starting to work well.

pop_tree_test_01.jpg
pop_tree_test_02.jpg 
Title: Re: population madness
Post by: Dune on October 28, 2024, 02:15:33 AM
These look great, very natural. Glad it works ok. Nice bit of eroded hillside, btw.
Title: Re: population madness
Post by: digitalguru on November 07, 2024, 06:41:31 AM
Experimenting in Maya with this. I'll have to do the foreground trees in Maya anyway as I have a vehicle driving through this scene and I need to have the tree shadows casting on to the car. The trick to this as you mentioned, is to reduce the opacity of the leaf shaders ( but keeping it just above 0.5 as anything at that value or below just makes opacity 0) I get why TG is doing this - using opacity masks for leaf cutouts is not too taxing on the renderer (as opposed to using transparency).

Trying this in Maya I get much the same effect, it's the shadows from the leaves that mostly darken the scene. I'm using a ray switch shader to use a shader just for leaf shadow casting which has transparency set to the leaf color.  In initial tests simulates the effect of light diffusing through the trees (still testing though and not sure how much overhead this adds to render times for a forest of trees :) ).

It's a gnarly problem, and even in Maya/Arnold, there doesn't seem to be a way to do this other than "faking" it (i.e separate shader for the leaf shadow casting). But as this type of scene is quite common in TG, maybe it's something for the future...
Title: Re: population madness
Post by: digitalguru on November 07, 2024, 06:54:14 AM
Here's a test in Maya to illustrate -

Standard shader:
tree_shadow_standard.jpg

Shader with ray switch for shadows (on leaves):
tree_shadow_rayswitch_for_shadows.jpg
Title: Re: population madness
Post by: Dune on November 08, 2024, 02:20:40 AM
The opacity shader is an interesting thing anyway. For hair masks for instance, I often set to 2 or 3 to strengthen the sometimes softish or very thin (jpg) masks to see all the hairs. And world opacity is an extremely useful thing too, e.g. to get rid of loose grass (from wider objects) on narrow paths, or too loose leaves of one pop on, say, higher altitudes.
Title: Re: population madness
Post by: Stormlord on November 08, 2024, 06:43:19 AM
Quote from: digitalguru on October 24, 2024, 05:54:20 AMTesting population renders a.t.m and this is the first time I've tried a scene where there is a canopy of trees covering the terrain. First thing I've noticed is while there a sufficient density of trees in my test scene to allow light through, I'm not getting much bounce on the ground, my shadows are still quite black. I've tried path tracing and standard renderer with more cache detail with similar results.

ANybody have any good tips for achieving this in TG? I'm trying to get a nice dappled light coming through the tree canopy.
What really helps is to render a separate vegetation pass and adding it with negative multiply in Photoshop.
I did this in some of my renderings, where I ran into the same problem...

This is a good way to go...!!!
Because with the percentage slider you can add very precise how much you will lighten up your vegetation.

Pacific Island 2024 - Vegetation Pass.jpg 
Pacific Island 2024 by Dirk Kipper

1 pass without vegetation
2 pass normaly rendered (trees are very dark!)
3 pass vegetation against a neutral black background -> Overlay in Photoshop with negative multiply 65%
4 final image with a bright and superb vegetation

That's the way I do it sometimes...
But doing it the way Ulco described is also a very clever solution.

STORMLORD
Title: Re: population madness
Post by: digitalguru on November 08, 2024, 06:51:02 AM
Quote from: Stormlord on November 08, 2024, 06:43:19 AMWhat really helps is to render a separate vegetation pass and adding it with negative multiply in Photoshop.
I did this in some of my renderings, where I ran into the same problem...
I'm planning to do something like that but in Nuke. I'll probably render the foreground flora in Maya and the background in TG. I'll also render out shadows from the Maya flora to comp over the TG terrain so I'll have more control.
Title: Re: population madness
Post by: digitalguru on November 08, 2024, 07:11:47 AM
Didn't see those images when I first refreshed, but very nice! Though my camera is very close to ground level so it's a whole diffrerent raft of issues... 
Title: Re: population madness
Post by: Matt on November 12, 2024, 11:41:50 PM
My 2 cents: If the shadow darkness is a persistent issue, even with path tracers, then the problem lies in one of the following places:

 - The albedo and/or translucency settings of the leaves (including the brightness of the textures).
 - The level of skylight (atmospheric conditions) or other sources of light in the scene
 - An expectation of the light levels and camera exposure that's inconsistent with the render settings.

Reducing leaf opacity to 50% is not realistic, because opacity represents how much direct light is blocked by the leaves, which is usually close to 100%. Scattered, bounced and diffused light through the leaves should be accounted for by reflection and translucency if a path tracer is working well, whether that is Terragen, Arnold, V-Ray, or anything else.

For every photo that has lighter coloured shadows we can also find examples of very dark shadows. It depends on the atmosphere, exposure, surroundings and so on.

If photorealism is important, these are the things I would consider. If not, feel free to use whatever techniques work for you.
Title: Re: population madness
Post by: Dune on November 13, 2024, 01:59:56 AM
Thnks for your input. I know it's not realistic, but it's an easy workaround. Sometimes you don't want more, or any, clouds to have more scattered light, if you increase exposure clouds or whitish objects are sometimes blown up, and if you still want lighter, softer shadow areas, opacity works.
What also helps is using (render) tonemap settings: soft clip effect, contrast.

Intriguing location , btw. I hope you settled in well.
Title: Re: population madness
Post by: digitalguru on November 13, 2024, 09:21:43 AM
I take Matt's point about the object opacity and it is a cheat (but all c.g. is a "cheat" really).

Here's some frames from a video I shot in Richmond recently, the the area in the first is quite open and light bounces around as you'd expect. The second frame is under a fairly dense canopy of trees and the ground is getting bounced light from the environment, but also a fair bit of diffused light transmitting through the leaves I'd say.
richmondtreeRef00086587.jpg richmondtreeRef00086642.jpg
Here's a few examples from the net to illustrate:
leaf_shadows_05.jpg
leaf_shadows_01.jpg leaf_shadows_02.jpg

Translucency doesn't help, no matter how translucent a shader is, its shadows are always black. This is the same in Maya, and the only way I've found so far is to pass a shader with colored transparency to shadows only is with a ray switch.

Dune's solution is the best so far, though lacks some physical plausibility, even when path tracing is on. Must admit I haven't played with path tracing much at all, but it seems not to help in this situation (though I may be missing something).

Next thing I'll try in Maya is adding a little contribution form a second dome light including on the ground, but exuding shadow casting from the trees. Actually light inclusions/exclusions might a good feature to add in Terragen (feature for Terragen 5 perhaps?)
Title: Re: population madness
Post by: Matt on November 13, 2024, 02:59:46 PM
I think the key here is exposure.

In these photos the contrast between sunlight and shadow is as high as what you're trying to avoid, in my opinion. Look how overexposed the sunlight is in some places (outside of penumbra). Why is this accepted in a photo but deemed unrealistic in a render?
Title: Re: population madness
Post by: Matt on November 13, 2024, 03:00:43 PM
Thanks Dune. I am settled in well. Mammoth is an awesome place!
Title: Re: population madness
Post by: Matt on November 13, 2024, 03:18:17 PM
I want to solve this too. I hope I don't sound unreasonably argumentative 😬 But I think at least half the problem is exposure, before we look at what else could be done.
Title: Re: population madness
Post by: digitalguru on November 13, 2024, 03:51:28 PM
Quote from: Matt on November 13, 2024, 03:18:17 PMI want to solve this too. I hope I don't sound unreasonably argumentative 😬 But I think at least half the problem is exposure, before we look at what else could be done.
NP Matt, it's a tricky one to light for sure, and as you say exposure is key, though I think some "cheating" might be the key i.e light/exclusions for the different elements. moving all the populations to Maya for that reason. My main point is that shadows don't respect translucency (or SSS in Maya) and it's half the battle, but I'll figure something out :)
Title: Re: population madness
Post by: Matt on November 13, 2024, 04:06:50 PM
Light from leaf SSS/translucency will land on the ground with path tracing (std render/GI cache too, but not very well). I don't think we're missing any major terms here - it's different from the coloured glass transparency issue. But the leaf shaders need to be bright enough in diffuse colour and translucency to make this a strong effect.
Title: Re: population madness
Post by: digitalguru on November 13, 2024, 04:10:13 PM
I tried that with path tracing, but it didn't work, what am I missing?
tgout-001 01m33s v4.6.31.0.jpg
Title: Re: population madness
Post by: Matt on November 13, 2024, 07:51:33 PM
I think this is a very different kind of scene. The ground would need to be mostly in shadow and surrounded by leaves, like in the photos you posted. I will set up an example and show you what I mean.
Title: Re: population madness
Post by: Matt on November 13, 2024, 08:59:02 PM
green-canopy-of-cards_pt.jpg

Sorry it's an ugly test, and not with real leaves. But this shows that if most of the environment is a green canopy then the ground picks up the green. I increased exposure slightly, but only to a value of 2. Your photos have much higher exposure where the sunlight is overexposed. I could have done that here and it would have made the shadows even lighter.

Your test renders on page 1 are mostly lit by the open sky, so the shadows won't look much different from the default scene. If you put yourself in the position of a pixel on the ground, and look at what's all around you, that gives you some idea of what colour the shadows will be. If it's mostly sky, the shadows will still be dark blue. Compare this with the photos you posted. In the photos the ground is mostly in shadow (at least 50%), surrounded by green leaves. There's one exception where the shadows are blue, but in that photo the exposure is very high. Where the sunlight hits the ground it is *very* bright, which means the exposure was increased considerably.
Title: Re: population madness
Post by: Matt on November 13, 2024, 09:41:15 PM
green-canopy-of-cards_UI_smaller.jpg
(Bad quality screenshot because I'm going through remote desktop)

If you boost your leaf shaders to these settings and surround the area with trees I think you'll be able to get plenty of green light on the ground. But the texture maps will have a darkening effect, so be careful with those. I increased the PT quality to 64 but this is just a quality/AA trade-off, and I don't think it's necessary for the effect. Not shown: Camera exposure = 2. This alone is enough to brighten the shadows quite a lot.
Title: Re: population madness
Post by: Matt on November 13, 2024, 09:54:50 PM
green-canopy-of-cards_pt_view2.jpg

To give some perspective: as we move away from the trees, the shadows return to the colour of the sky. This is because it's not the leaf opacity that allows the extra light on the ground, it's the light scattered down from many directions.
Title: Re: population madness
Post by: Dune on November 14, 2024, 01:48:57 AM
This is very interesting. I'll do some tests with 'real'  trees.
Title: Re: population madness
Post by: digitalguru on November 14, 2024, 04:32:42 AM
Yes, very interesting! Thanks for the example Matt. I'll try it today with some leaf shaders and see how that goes, and to see if I can get a bit more contrast in the scene.
Title: Re: population madness
Post by: digitalguru on November 14, 2024, 06:51:33 AM
I tried it with the textured leaf setup and, as you said the ground suffered quite a lot. The version that works makes the leaves go a bit nuclear, so I comped the canopy (with a "standard" leaf setup) over the ground with your setup ( and tried a liittle of Dune's opacity hack, though not so much - 0.85)

Haven't played with the shadow catcher shader as yet, but that might offer some flexibility, will try that when I have a bit more time. And of course, splitting into render elements should give a bit more control.

canopy_comp_01.jpg 
Title: Re: population madness
Post by: Dune on November 14, 2024, 07:43:29 AM
I did a quick test too. The leaf texture should really be pretty light. Interesting that translucency 2 and lighter leaves takes so much longer.
Title: Re: population madness
Post by: digitalguru on November 14, 2024, 08:15:31 AM
Dune - good tests! Much more thorough than mine! I like the last two best, but would say somewhere between those two(trans=1.5?) Would be interesting to see more direct light breaking through the canopy throughout (for a more "dappled" scene) not just that central area. Also interesting to see the best result (at least to me) is with exposure at 1 (assuming that's what "exp" is), more useful as its not blowing out the rest of the scene just to get those shadows working.

Yes, experienced the same slowdown here (with higher translucency) as soon as I plugged textures into Matt's basic setup it rendered in a fraction of the time.

Edit: Did you try playing with the sunlight shadow softness? I tried reducing it in mine to allow a little more direct light through. Would also be interesting to see some direct shadow from the trees to see how this setup affects it.
Title: Re: population madness
Post by: Dune on November 15, 2024, 01:30:09 AM
I don't think translucency should be higher than 1 (not natural). I usually use around 0.4-0.6, but I may have to revise that strategy. Depends on the species of course, some have thicker blades in nature, letting less light through. It should also carry a texture (leaf nerves and all that), but I never do that, if only because a translucency mask is not quickly derived.
Exp=exposure indeed, and I think the one before last would be the goal, but with higher exposure. Quicker to render too, the latter is just too slow. I never thought it would take more time, I thought it would be a fixed number of light reflections/passes to be computed.

No I didn't change the shadow softness, I usually keep that at default (as it's the natural softness). What I also do occasionally is hovering an invisible (slightly illuminated) plane or dome above some dark area. But it's a cheat too, and takes time, and produces more grain. A little no shadow sun also helps, but then you sometimes get light inside parts you don't want light in (nose holes ;D ).
Title: Re: population madness
Post by: digitalguru on November 15, 2024, 05:05:45 AM
Quote from: Dune on November 15, 2024, 01:30:09 AMI never thought it would take more time, I thought it would be a fixed number of light reflections/passes to be computed.
Yes, that surprised me too, maybe Matt can shed some light on that.

For me, I think a lot of comp love is needed to get this working, to separate leaf shader values for shadow casting and beauty renders, but it's encouraging you got it working at a standard exposure (thinking about the last two images in your sequence). B.t.w in your last caption "exp 1 trans 1 opac 1 leaf 2" what is "leaf 2"?
Title: Re: population madness
Post by: Dune on November 15, 2024, 07:48:34 AM
I set the leaf texture base color to 2, which is pretty extreme IMO. Especially since the leaf texture itself wasn't overly dark.
Title: Re: population madness
Post by: digitalguru on November 15, 2024, 07:52:35 AM
Ah, I see, makes sense. It's that color contribution pushing up the render times then.
Title: Re: population madness
Post by: Dune on November 16, 2024, 01:08:36 AM
I still wonder why it would take a renderer longer to multiply something by 2 than by 0.8 ... ;)
Title: Re: population madness
Post by: digitalguru on December 01, 2024, 07:08:42 PM
Here's a very rough first test of the forest layout and lighting - still quite a bit to do, but getting close to what I'm aiming for:

comp_test_03.1001.jpg
Title: Re: population madness
Post by: Dune on December 02, 2024, 01:36:17 AM
Looks very good so far.
Title: Re: population madness
Post by: digitalguru on December 08, 2024, 06:35:24 PM
another WIP:
comp_test_v04_02.1408.jpg
Title: Re: population madness
Post by: Matt on December 08, 2024, 07:28:09 PM
It feels dark compared to your reference photos, but that can be fixed by increasing exposure. (At the risk of me sounding like a broken record!)
Title: Re: population madness
Post by: digitalguru on December 08, 2024, 07:41:34 PM
I take your point, I think I need to get a bit more contrast more than anything. A lot of this is in the comp, so very tweakable.
I found some nice reference after I started this and I'd like to get closer the the image below:

dodge_powerToTheWeekend_000054596.jpg
Title: Re: population madness
Post by: Matt on December 08, 2024, 07:44:47 PM
My advice would be to get more shadow into your scene (so the spots of sunlight are few and far between), don't try to force the shadows to be lighter than the path tracer renders (relative to sunlight) so the contrast between sunlight and shadow stays high, don't change the default sunlight diameter, and increase exposure to get the shadows where you want them to be.
Title: Re: population madness
Post by: Matt on December 08, 2024, 07:46:32 PM
...and then crush the blacks slightly in comp.
Title: Re: population madness
Post by: digitalguru on December 08, 2024, 08:01:26 PM
Early days yet, just a quick comp while I'm dressing the scene with foliage. Actually the only Terragen element is the terrain. The flora and shadows are comped from Maya... But yes, I take your point in embracing the shadows.