Shadows
by arteria3d · in · 12/07/2004 (10:42 am) · 10 replies
HI,
I believe that it is the collision boxes of objects that create the baked in shadows on the terrain. Problem is, i just use a small box around the trunk base for collision, - so how can i get a nice tree shadow on the terrain.
Like i have seen in other apps, is it not possible to have proper shadowing of objects? like trees with there branches shadowed on the terrain??
Cheers
Steve
I believe that it is the collision boxes of objects that create the baked in shadows on the terrain. Problem is, i just use a small box around the trunk base for collision, - so how can i get a nice tree shadow on the terrain.
Like i have seen in other apps, is it not possible to have proper shadowing of objects? like trees with there branches shadowed on the terrain??
Cheers
Steve
About the author
Owner of uk based Ltd company ArteriaMediaLtd. with a trading name of Arteria3d Website;arteria3d.com
#2
12/07/2004 (11:41 am)
It's my understanding that the Lighting Pack uses the collision boxes from the DTS model to cast shadows. So, you'll have to build at least rough collision boxes around your tree trunk and branches for shadows to be cast by them.
#3
12/07/2004 (12:05 pm)
Why on earth does it use the collision boxes??? Is this something to do with the way the torque engine works??? A little frustrating - as i noticed on the demo that comes with the lighting demo, that the shadow effects given by the trees, just look like back straight lines on the terrain.... Is there a way a model can use poly collision, so i could have at least a few trees, that render nice branch effects on the terrain - i know at a cost of fps - but i would only have a few??
#4
12/07/2004 (12:08 pm)
As an extra thought i wonder whether anyone has had a go at manipulatng the existing stencil shadowing of the player character to be used on statics shapes and instead of rendering every frame, like the player character shadow - it could just be 'captured' and then baked into the terrain?
#5
12/07/2004 (12:11 pm)
Well, you can have up to 9 collision boxes and they can be as detailed as you like, so long as they remain convex. What's the difficulty with using collision boxes? Why is that frustrating?
#6
Maybe there are other ways with the pack to achieve the results i desire - thanks for your posts guys
12/07/2004 (12:20 pm)
Not so much difficulty mate - just that i want the actual branches to apear as shadows, so u can effectively see a loose shape of a tree in the shadow. Even using 9 collision boxes, would still render the shadow like a block tree. The way the pack renders dts shadows, is similar to an effect i can already using a black texture and painting on the ground.Maybe there are other ways with the pack to achieve the results i desire - thanks for your posts guys
#7
12/07/2004 (12:22 pm)
There are less collision boxes than polys in an object. To get a proper shadow you'd have to do all the polys in an object which would be VERY time consuming. I wonder if the same routines that people are doing for cell shading could be used to quickly get a rough outline?
#8
I am currently designing a farcry based game with lots of trees with levels of LOD and nice tropical foilage - but what is spoiling the effect, is the objects dont blend as good as they could - and thus the illusion of reality is spoilt by the harsh placement of objects directly into the terrain. I am sure with the highlly advanced programming that must render stencil shadows for the player etc - can be altered so that they work for all dts shapes - this would be amazin and throw a whole load of realism into torque based games.
12/07/2004 (12:26 pm)
I know about the time consume thing!!! I use a building creator called cartographer shop, which has been mentioned on these forumns - and that bakes real poly based shadows into the textures. Results look stunning - but can take anything from 10 mins to 30mins or more for a bilding or terrain - to prepare the shadowing out - but the end product is worth it cos of the detailed look.I am currently designing a farcry based game with lots of trees with levels of LOD and nice tropical foilage - but what is spoiling the effect, is the objects dont blend as good as they could - and thus the illusion of reality is spoilt by the harsh placement of objects directly into the terrain. I am sure with the highlly advanced programming that must render stencil shadows for the player etc - can be altered so that they work for all dts shapes - this would be amazin and throw a whole load of realism into torque based games.
#9
The real problem is: what to do with partially transparent textures? For example, a tree - do the leaves cast shadows? Part of them will, and part won't. You would have to use the barycentric coordinates to look in the texture map to determine whether you hit something, and it's level of alpha.
If the shadow resolution were greater, you could do cool things with that, like colored shadows from stained glass windows, etc.
12/07/2004 (1:15 pm)
Checking all the polies in a DTS is not that slow. You wouldn't want to do it every frame, but when you're baking in shadows, i bet you wouldn't even notice the difference. The real problem is: what to do with partially transparent textures? For example, a tree - do the leaves cast shadows? Part of them will, and part won't. You would have to use the barycentric coordinates to look in the texture map to determine whether you hit something, and it's level of alpha.
If the shadow resolution were greater, you could do cool things with that, like colored shadows from stained glass windows, etc.
#10
As for the trees in the TGE demo I didn't create those, and the point of that demo mission is to show how existing content can be used by the Lighting Pack, so I didn't alter the objects (that would be cheating :).
12/07/2004 (1:44 pm)
There are several reasons why the collision boxes are used, efficiency is one of them, however the main reason is that the terrain uses one 512x512 light map that's stretched across the equivalent of a square mile. You could add tons of detail to your objects, but the light map won't be able to show the detail. Often the level of detail that you can achieve with 9 collision boxes is far more than the terrain can show, so adding extra won't help.As for the trees in the TGE demo I didn't create those, and the point of that demo mission is to show how existing content can be used by the Lighting Pack, so I didn't alter the objects (that would be cheating :).
Associate Jaimi McEntire
King of Flapjacks
Calculate shadows for a terrain block at blend time by ray-tracing through the DTS instead of the collision mesh. Burn the shadows directly into the terrain texture. Cache the created terrain bitmap to the drive, so it doesn't have to be recreated every time the system starts up.
I've done this before on another engine, and the results were much better, though not perfect. Good enough in most cases, though.