show a tree's shadow and save it to the "lightmap.png&


07-06-2008 07:59:02

I only want to show a tree's shadow and a bulding's shadow,then I want to save these shadow to the "lightmap.png" file.
I don't need Dynamic Lighting and Dynamic Shadows.But I don't know how.
There is a function named "createTerrainLightmap" in ETM. I modify it.but things become worse.
Anybody can help me? thanks!


07-06-2008 08:42:44

That doesn't work. createTerrainLightmap only does what its name suggests, it creates a light- and shadowmap for the terrain itself. It is a specialised function to deal with terrain and terrain only, it cannot calculate shadows for any other object. Besides, since the terrain lightmap is spread over the whole terrain, its resolution would most likely be insufficient to adequately store a shadow for a tree.

You'll need a far more sophisticated approach. There is some info on the Ogre wiki about lightmaps for arbitrary scenes, maybe that can help you. But it's probably easier to get dynamic shadows to work.


09-06-2008 08:11:38

Thank you!