Opened 13 years ago

Closed 13 years ago

#867 closed defect (fixed)

Shadows flicker

Reported by: michael Owned by:
Priority: Release Blocker Milestone: Alpha 6
Component: Core engine Keywords:
Cc: Patch:

Description

I've noticed that the shadows tend to flicker now. This occurs on both my laptop and desktop. The laptop uses a mobile nvidia card and my desktop uses an ati Radeon card, so it does not appear to be graphics card-specific. Both use Windows 7 64-bit however. I notice no other graphical issues in either case, just the flickering shadows. When I say "flickering" I mean the shadows turn off and on in rapid succession. There is not a consistent interval to this either.

Change History (7)

comment:1 by Kieran P, 13 years ago

I have noticed the exact same thing while playing the other day.

As well as a much slower loading/game play speed than it was previously, even with shadows and water off.

I think something recently has degraded the performance. :-(

comment:2 by Erik Johansson, 13 years ago

Milestone: BacklogAlpha 6

After playing a while today I can confirm this as well. It seems like it is the shadows "on the sunny side" of buildings etc that flicker. I.e. smaller shadows underneath overhang from roofs etc, as well as shadows from smaller things like corpses. As far as I can tell the larger shadow areas doesn't suffer from this.

Moving this to Alpha 6 as it's starting to seem like an issue affecting multiple people on multiple systems (I'm using Windows XP, and an NVIDIA card - Gforce 9500 GT) and can distract you when playing the game, so should preferably be fixed before the next release. :)

The slower loading/gameplay speed would most likely be the AIs I'd say, tested the game on my Eeepc the other day and with an enemy AI it was too slow to be playable, without it was ok (not great of course, but ok :) ). I don't remember the exact framerate, but it was a considerable difference.

comment:3 by Jan Wassenberg, 13 years ago

Unable to reproduce on:

OS             : Win7 SP 1 (6.1.7601)
CPU            : IA-32, Intel Xeon W3550  @ 3.07GHz (1x4x2), 3.08 GHz
Memory         : 12288 MiB; 9128 MiB free
Graphics Card  : NVIDIA GeForce GTX 460
OpenGL Drivers : 4.1.0; nvoglv64.dll (8.17.12.6099), nvoglv32.dll (8.17.12.6099)
Video Mode     : 1024x768:32

I've left the Death Canyon map open for a minute or two in a debug build, and ran the We Are Legion map in release. Performance is mostly as expected save for about 4..5 ms per frame in skinning, which is however reasonable for so many on-screen units. Besides the AI, might unexpected delays during loading be due to texture and XML conversion? (Those are really expensive; the first game after a data-heavy update will be slow.)

The closest thing to flickering I saw is when the shadow is long and thin and the low resolution of the shadow map pixels cause temporal antialiasing. However, that just happens when the camera (or model) is moving.

comment:4 by Erik Johansson, 13 years ago

Tested again today, and two things seems to increase the risk of seeing this bug. First, it seems more likely to occur in a longer game, though that might just be as it's more likely to produce no 2. Second, more objects, or perhaps more specifically, many objects that change at a time, seems more likely to trigger the flashing shadows. The best procedure to reproduce it so far is to load a map with a decent number of objects, I saw it on Barcania the other day and on Gambia River today. Next let the game run for a while, creating units, scout for the enemy, build a couple of buildings. Finally, either wait until the flashing appears (might take a long while I must have played for at least 15 minutes or something before seeing it the other day) or click the "Reveal map" checkbox in the Dev overlay, that triggered the bug for me both the times I've tested today.

comment:5 by historic_bruno, 13 years ago

I've noticed this for a while as well and discussed it in IRC with Philip. I think it's independent of drivers or GPU. Apparently it's to do with the boundaries of the shadow map being updated, which happens when moving the camera OR if there's something like an animal on the boundary. You can check that by zooming out a little, or looking at the minimap, you'll probably notice something moving just off-screen.

<Philip`> They're particularly bad when the boundary of the shadow map is defined by a moving animal
<Philip`> There's improvements that should be made, but they probably need some architectural changes first
<historic_bruno> where's the boundary of the shadow map?
<historic_bruno> (one thing I notice that triggers it quickly is to use the "reveal map" option)
<Philip`> Consider all the shadow-casting objects (excluding terrain, I think) that are visible from the standard camera view (plus a bit of tolerance around the edges)
<Philip`> then view all those objects from the (infinitely-distant) location of the sun
<Philip`> The bounding box of those objects from the perspective of the sun is what defines the edges of the shadow map
<Philip`> (Tht's a totally backwards way to do it, I think - the shadow map ought to be controlled by the visible shadow *receivers*, then you render any shadow casters that overlap the shadow map from the sun's perspective)
<Philip`> (and then you add some kind of quantisation so minor changes in the visible receivers (e.g. by rotating or panning or zooming a little) don't alter the world-space boundaries of the shadow map, so that it has little visible jitter as the camera moves)
<Philip`> ((though that sacrifices resolution a little))

Can we find a revision in which this didn't happen or was less pronounced?

comment:6 by Kieran P, 13 years ago

Priority: Must HaveRelease Blocker

comment:7 by philip, 13 years ago

Resolution: fixed
Status: newclosed

(In [9761]) Fix use of outdated cached transform when computing bounding boxes. Should fix #867.

Note: See TracTickets for help on using tickets.