Opened 13 years ago

Closed 13 years ago

#661 closed defect (duplicate)

Shadow Map quality degrades the more objects there are on a map

Reported by: Michael D. Hafer Owned by:
Priority: If Time Permits Milestone: Alpha 4
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by Michael D. Hafer)

The shadow quality in the game and in Atlas is inversely proportional to the number of objects on a map. Size of the map may have an adverse effect as well.

My specs:

OS : WinXP SP 3 (5.1.2600)

CPU : IA-32, AMD Athlon XP 2600+ (1x1x1), 1.92 GHz

Memory : 1536 MiB; 541 MiB free

Graphics Card : RADEON 9800 XT - Secondary

OpenGL Drivers : 2.0.6458 WinXP Release; atioglxx.dll (6.14.10.6458), nvoglnt.dll (6.14.10.9147)

Video Mode : 1920x1080:32@60

Sound Card : NVIDIA(R) nForce(TM) Audio

Sound Drivers : nvapu.sys (6.14.0462.0 built by: NVIDIA), OpenAL32.dll (6.14.0357.19), wrap_oal.dll (2.1.4.0)

Attachments (2)

nice-shadow.jpg (354.8 KB ) - added by Michael D. Hafer 13 years ago.
Nice shadow. Giraffe is the only object on the map.
ugly-shadow.jpg (385.0 KB ) - added by Michael D. Hafer 13 years ago.
Ugly shadows. Map has hundreds of objects.

Download all attachments as: .zip

Change History (7)

by Michael D. Hafer, 13 years ago

Attachment: nice-shadow.jpg added

Nice shadow. Giraffe is the only object on the map.

by Michael D. Hafer, 13 years ago

Attachment: ugly-shadow.jpg added

Ugly shadows. Map has hundreds of objects.

comment:1 by Michael D. Hafer, 13 years ago

Description: modified (diff)

comment:2 by Erik Johansson, 13 years ago

I know more or less nothing about how graphics cards do things so I may be completely wrong about everything I say, just a warning ;)

It seems to me like it's using one shadow map for everything on the map(/screen), perhaps one shadow map per light or something but that doesn't change much when we only have one light. Is there any setting to change the size of the map?/Change the behavior?

(I'm getting interested in how other graphics cards do this since I don't see the same issue (am using an Nvidia card myself), do they use some kind of dynamic maps or one map per object or something? Anyone who knows more about these things?)

comment:3 by Philip Taylor, 13 years ago

#504 has some technical details. The number of objects on screen shouldn't matter - what matters is the volume occupied by in-camera objects, and the cross-sectional area of that volume from the perspective of the light source. If you only have one object then it covers a small area (as seen by the light), so the entire shadow map is devoted to it; if you have widely-spaced objects then the same shadow map has to be stretched over a much larger area so its resolution is lower.

The number of pixels in the shadow map is computed from the screen size (so it'll be particularly low in Atlas's little window). If your graphics card supports the GL_EXT_framebuffer_object extension then it'll be rounded up to a power of two so it's a bit better. I have no idea if there's an easy/fast way to get higher-res shadow maps than that.

comment:4 by Kieran P, 13 years ago

Priority: Nice to HaveIf Time Permits

comment:5 by Philip Taylor, 13 years ago

Resolution: duplicate
Status: newclosed

The behaviour described here isn't really a fixable bug - the ugliness should be improved by work on #504/#743 instead, so I'll close this ticket as redundant.

Note: See TracTickets for help on using tickets.