Hi Oshyan... Here are the results of my masking test... it's looking very promising
On reflection there are different situations that will break things in different ways. To deal with each of these, I ended up using all 3 options mentioned in my previous post.
- A circular image map for near camera objects
- A wedge-shaped mask projected through a camera pointing down directly above the render camera
- A "through the lens" mask through a duplicate of the render camera with a slightly increased fov.
[attachthumb=#1]
The first compensates for a low camera position, catching objects behind the camera that may extend into the render. The size of this is arbitrary here but you could easily calculate this.
radius of circle = width of object / tan (fov
mask - fov
render)
<edit> I should have calculated it. For a 10m wide object I could use 300m instead of the 500m I picked at random in this test
</edit>While the last two masks may appear to do the same thing, they do cover certain situations better. The last one may not populate the far side of ridges resulting in serious omissions in gently undulating terrain with a low camera angle, but it will correctly mask a wide angle camera tilted downwards from a high camera altitude.
Attached the TGD and image masks for you to try. Not sure how stable this will be in a render but it does have considerable potential to populate large areas efficiently, and the masks can be easily animated.
There are probably better ways to put these together but I find it easier to use little building blocks so that I can see what I'm doing, and modify things one bit at a time.
Crossing my fingers now... just started rendering a sequence from my QTVR. With a bit of luck this may work around my problem of the sequence crashing after frame 1. I'll find out in an hour or two....
Nope. Grass population was still high (133,000) and it crashed. Changed the scale and spacing of the grass and trying again. 65,000 this time.... still crossing fingers. Tree populations are only 2,500 though, which is a big improvement for a 20km square... and RAM usage is down to 500-600Mb, nearly half of previous renders!!
BINGO!!!
... well it's started rendering frame 2 anyway. I'll have to work on a good fake grass surface for distances over say 100m. The distant grass objects were certainly increasing render times a lot anyway. Frame 3 now
Thanks for giving me the extra nudge to extract the idea into a working model.
The other good thing is that it was relatively easy to incorporate it into an existing project. Edit the camera and image map locations and then slot the final shader into the existing node network.
[attachthumb=#3]
With the modular approach that I use, it's also easy to duplicate for use with multiple density shader networks. All you need to do is duplicate the last shader and input the last Add colour into its fractal breakup input.
Frame 4 now