Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Today I was looking at a still frame of a game, and noticed that all of the shadows were dynamic (created per frame). As we know, shadows can be quite expensive. I was wondering why shadows could not be simply mapped at run time for non moving objects, and then only do dynamic shadows for players, vehicles, etc. What are the advantages/disadvantages of doing this?

share|improve this question
    
Quake 2 does this; Carmack indicated that there are really no disadvantages - just really good looking shadows that are fast. –  Jonathan Dickinson Dec 22 '11 at 9:28
1  
You can't have dynamic light sources if you bake the shadows from terrain/scenery can you? –  ClassicThunder Dec 22 '11 at 9:42
1  
What if you have notmoving house and static light source. And you bake out house shadow to texture of the ground. What would happen if you move with your player to the shadow of house? Player won't be "shadowed" - am I right? –  zacharmarz Dec 22 '11 at 9:46
2  
Differences in quality and visual appearance between dynamic and static shadows is the main one I can think of; this kind of visual discontinuity can be quite jarring once you start noticing it. –  Jimmy Shelter Dec 22 '11 at 10:48
1  
@zacharmarz that's what I meant by 'good enough'; not good enough for a AAA title; but maybe acceptable for an indie one. Either way you can trim down the number of dynamic lights with precalc (especially in angular/indoor/futuristic environments). –  Jonathan Dickinson Dec 22 '11 at 14:10
show 7 more comments

1 Answer

up vote 3 down vote accepted

Disadvantages:

  • Lightmaps are very large textures. If you have enough processing to make all shadows dynamic you can probably use the memory for something else.
  • Non unified lighting model. Some lighting models like deferred don't mix well with prebaked shadows.
  • Light mappers are usually very slow. You need to wait few hours to preview lighting changes in the scene.
  • You can't pre-bake lights in case that light sources are moving even if everything else the scene is static.

Advantages:

  • You can have much higher quality shadows and lighting.
  • Faster processing
  • Virtually unlimited number of light sources can be used
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.