Archived

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

brucesinner

Best shadow algorithm

Recommended Posts

brucesinner    144
I''ve seen lots of shadow algorithm in books, web, tutorials ... but which one is the best? I know that you people will answer that in some case that one is better, in another case is better to use other and so on...And it is certainly what I want to hear...so i''m waiting!!! :-D Thanks

Share this post


Link to post
Share on other sites
Krohm    5030
Still to try extensively however, I like shadowmaps a lot. I feel when we''ll get 4kx4k shadow maps we''ll have enough resolution however...
Stencil volumes are always more detailed (eye-space) but they are vertex ops and this may be a problem (always the same wire example).

I think shadow maps will turn out to be the best even if I woudn''t put a money on that.

For old algorithms such as planar shadows and stuff like that... simply ugly.

Share this post


Link to post
Share on other sites
RipTorn    722
there is a lot of room for improvement in stencil shadowing... So I reccommend them.
Stuff that isn''t quite as easy when dealing with shadow maps...

Things like working with static and dynamic geometry seperatly, removing needless volumes, restricting volumes, etc. You can''t really do that sort of optimization easily with shadow maps.. You pretty much have to re-render shadow maps every frame if there is something dynamic in them.... Well, thats my view anyway. The end result though still is that it''s absolutly insanly cool what can be done in real time these days

personally I''ve been working very hard on these sorts of things... and I think it''s paid off pretty well my current test code is rendering the nv15 Q3 map, using stencil shadow volumes based lighting, 115 lights on screen in the main room, 15fps... admittedly most are quite small lights, but still. I''m sure it can be done with other methods too. Just needs lots of work like I did.

The thing I''ll finally say is this,
and this does contradict what I''ve just said,

don''t listen to others


expeirment, and find out for yourself what you prefer. And don''t use other peoples code/ideas on how to do things. I started working with shadow volumes a couple of years ago, I''ve never (at least seriously) read any white papers / example code on how to generate / render them... I just worked them out for myself (with very little success for agse ) This has let me work out how to do them myself, I understand them completly I feel, and can exploit them a bit here and there... Sure it took ages, but I learnt a metric tonne of stuff along the way.

so,

Go ahead, prove me wrong about shadow maps, make them better than anything, or invent some crazy new method. Just don''t follow blindly what others tell you.

| - Project-X - my mega project.. getting there... - | - adDeath - | - email me - |

Share this post


Link to post
Share on other sites
Krohm    5030
Oh well, actually I agree on most things you said.
The main thing I like of shadow maps is that they can get 'the wire' while stencil volumes cannot... This may not be a problem since the wire may become built from real vertices in the future.
I also think shadow maps doesn't need to be generated every frame (at least projected however) and I know pixar uses them. The problem is that they may eat up a lot of memory.

Isn't this a discussion forum anyway?
I like how this is turning out. Looks very costructive to me.

BTW, congratulations RipTorn for you project. Looks cool. I mailed you sometime ago but the e-mail got lost. I see I'm not the only one which is working on a internal GUI system...

EDIT: BTW, ...
EDIT: minor additions.
[edited by - Krohm on May 29, 2003 1:26:49 PM]

[edited by - Krohm on May 29, 2003 1:28:02 PM]

Share this post


Link to post
Share on other sites
RipTorn    722
quote:
Original post by Krohm
I mailed you sometime ago but the e-mail got lost.


yeah it would seem so, I''ve never got an email from your adress... you can resend if you want...

Share this post


Link to post
Share on other sites
Maximus    124
Im a fan of shadow volumes personally.

As has been said, with shadow maps you have to render the whole scene again from the lights perspective if something has moved in it. For omni-directional lights it takes 6 renders as well, and for fairly decent detail, you need a high resolution shadow map.

With shadow volumes, after youve generated static volumes once, you dont need to generate them again, rather you can store them in a display list and just call that to render the volume. They also work quite nicely with per-pixel lighting, and in my experiences, adding shadow volumes to a renderer which had PPL already gave a nice speed increase in areas with multiple light sources.

However, shadow volumes can only produce hard-edged shadows, whilst shadow maps can give blurred fake-soft-shadows.

Whats best for you is what works best in your situation.

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack

Share this post


Link to post
Share on other sites
Krohm    5030
Hey! I never took in serious consideration the compute-once for static light method. Wow, this is cool.
However, they still can''t render ''the wire'' correctly. Oh well.

Share this post


Link to post
Share on other sites
Basiror    241
i am planing to use shadowmaps for my current engine because lightmaps are even more memory consuming

my scenes have around 52000 static triangles in the players view

now sum this up for the entire map you the lightmaps would blow your vid card memory


shadow maps are just the best way to go with

you need to get the lastest drivers for NV cards atleast since nvidia speeded the readpixel function up a lot(at least that s what they wrote on their page)

you can use a high res shadowmap and render the entire visible scene once

for pointlights you use a low res shadow map

asfor omnidirectional lights
well you can do everything even on modern hardware

you need to make your decision between speed and superquality
of course you can do everything realtime but even hl2 has some selfshadowing issues so who cares about one shadow more or less
in the game action you don t care about these details anyways

Share this post


Link to post
Share on other sites
mcweddo    122
For optimal solutions a hybrid aproach is the best. Use shadow volumes for static and very slowly updating geometry (the thing is that you can precompute them which is not possible with shadow maps) and also bigger coarsely tesselated geometry because of texture aliasing problems, while shadow maps are a great for characters, special effects (fans, fences, fast motion) and smaller very detailed objects. Of course there are also PSMs to consider (perspective shadow maps) which beat the traditional linear shadow maps (i.e. same computation cost, less aliasing artifacts).

As a side note, for omni-directional shadow mapping you don''t need 6 passes, 2 will suffice with dual-paraboloid shadow mapping or just pass for a hemisphere (see brabec et. al. http://www.mpi-sb.mpg.de/~brabec/). Though this techniques induces some seriuos aliasing problems. You can just use this technique: cull each light frustum (if omni-directional there are 6 frustums) and remove ones that are not needed, so just render the ones you need.

Vedad H.

Share this post


Link to post
Share on other sites
mcweddo    122
Also I forgot to mention that shadow maps are best suited for outdoor scenes where you probably have one directional light (the sun). Also when it comes to soft shadows (in case you want to do them) shadow volume techniques are best suited for the approach, thoug there are ones for shadow maps also.

[edited by - mcweddo on June 1, 2003 7:44:06 AM]

Share this post


Link to post
Share on other sites
BGCJR    100
you can use a Dual Parabolic Shadow Mapping for point lights.
check out the demo

http://nehe.gamedev.net/files/dpsm.rar

And maybe combine it with the BSP loader 6 at www.gametutorials.com

Bobby

[edited by - bgcjr on June 1, 2003 12:22:11 PM]

Share this post


Link to post
Share on other sites