Archived

This topic is now archived and is closed to further replies.

Raduprv

Shadows

Recommended Posts

I want to change the way we have the shadows in Eternal Lands. basically, I project the shadows on the ground, writting on the stencil buffer, and then drawing an alpha blended square all over the screen (stencil testing and all). This looks good for flat planes, and it''s relatively fast, but: 1. Has hard shadows. 2. Shadows are projected properly ONLY on the ground plane. 3. No self shadowing. 4. No shadowing of other objects. In many places I can get away with the shadows looking weird on water, or on higher terrain, but I think it''s the time to finally implement some decent shadows. I want an algorithm that can overcome all the problems I enumerated, and be resonably fast, and if possible easy to understand and implement. We also have a LOT of geometry in our scenes, and the sun moves, so volumetric shadows or shadow maps are out of question. Oh, and we use an Ortho view (our game is Isometric 3D). So far, the obvious candidate is deepth map shadows. Does anyone have any other ideas?

Share this post


Link to post
Share on other sites
instead of depth buffer shadows you could use z-buffer shadows, or shadow maps :-)

...or volumetric shadows... how HIGH can your polygons be? And you can always use a lower-poly version of your models (they won''t be that big if you''re using an isometric view so the detail loss won''t be that noticable). The only problem is hard shadows, however you can render the scene to a small (say 256x256) texture initialized to zero alpha, with color writes disabled, then render the shadows (enabling rgb writes of course) and lastly render the texture to the screen. This will produce somehow soft shadows and the rendering process will be a bit faster.

Share this post


Link to post
Share on other sites
Trust me, our geometry is huge.
Even 30K triangles/scene, in some places (it''s an MMORPG, so sometimes the players crowd). Volumetric shadows are really not an option.

Share this post


Link to post
Share on other sites
What about good old shadow textures - render each player (or groups of players) into a textures with solid black textures, then project onto the terrain. Gets you fake soft shadows that lie properly on irregular terrain. No self shadowing though, but its still quite an improvement.

Share this post


Link to post
Share on other sites
I tried that a while ago, the problem was that they looked blocky. I tried with a 512 texture. I am aware that the shadow maps will be blocky too, but at least they give self shadowing, and everything cast a shadow on everything.

Share this post


Link to post
Share on other sites
The blocky appearence can be fixed by rendering to your texture with antialiasing on. On more recent cards that gives better performance and appearence than just increasing the resolution of the texture. If you''re after a really high quality output then you can blur the result fairly easily as well.

While shadow mapping might be a good idea, I think you''d be restricting the number of users that could see it at its best to people with much more recent hardware.

Share this post


Link to post
Share on other sites