Metacloud hack to reduce render times for "sun through terrain" scenes

Started by domdib, August 27, 2009, 04:04:51 PM

Previous topic - Next topic

domdib

Here's a little hack to allow the camera to look straight at the sun behind terrain WITHOUT having to switch on Ray traced shadows in atmosphere, thereby saving big on render time.

Go get dandelO's metacloud clip file from here: http://forums.planetside.co.uk/index.php?topic=3691.msg50573#msg50573 (Thanks dandelO!)

Insert in your scene of choice, and then delete two of the three metacloud objects (you will probably need more than one, but it's easier just to duplicate the one you're going to tweak)

Go into the Meta-cloud layer to tweak the cloud settings. Since it's going to be used to block the sun, and won't be visible in the scene, you want a low quality, high density cloud - I set Density at 10, Quality at 0.1, Acceleration cache at aggressive. I also set both the colour of the cloud and its scattering colour to white. Your mileage may vary according to need.

This is where it gets a bit fiddly. Find your troublespot in the terrain, and position the Metacloud behind the terrain, in line with the sun. You may find at this point that one object isn't enough, since one big one still seems to let a halo of light leak through, even though the bright spot is gone. So duplicate object and cloud layer, and do some further blocking.

That's it!

On the scene I'm currently working on, this cuts render times to a quarter what they would be with RTS on, so although it's fiddly, it's well worth it.


domdib

Are you sure that works? I tried a sphere object, and the sun just shone through it too.

Oh, and how the heck do you make a plane vertical?

domdib

Just tried putting a plane between the sun and the camera, and the plane just disappears - so I don't think that works.

FrankB

the plane doesn't disappear on my end, but you're right in that the sun glow shines through. The plane is one-sided, though, so maybe you are looking at it from the "wrong" side.

Making the plane vertical is realtively easy. You have two edge vectors. At default values, vector a points into the x direction, and vector b point in the z direction. These two vectors, multiplied by the length a and b, span a plane for you in 3D space.
Imagine x is right, y is up and z is depth. Now point with your index finger to the right, and your thumb away from you. That's the default orientation of the plane. Now, still point your index finger to the right, but turn the hand so that your thumb point upwards. That's the orientation you want for your vertical plane, right?

For a vertical plane, sitting on the x axis, you can leave vector a at its default, but need to have vector b point in the y direction instead. So you have the following vectors: a(1,0,0) and b(0,1,0)

For other directions and angles, use values between -1 and 1.

Cheers,
Frank

Seth

good tip but doesn't the clouds create shadows ?
I mean, does the lighting is the same with this tip and with RTS on ?

domdib

I haven't compared RTS on AND the clouds, with just the clouds. I have compared just RTS on with just the clouds on, and the results looked almost identical - see below (as I explained, you have to fiddle to get complete blockage of the sun). If you mean, could I see the clouds casting any shadows in the atmosphere, then no, I couldn't. It's not likely, as I positioned the clouds close to the back of the terrain.


Seth

oh no you misunderstood me, i asked exactly what you tried ;)
i can't see the difference on this scene, so this is a very good tip to me ^^