Visual Glitch - dyn lights, shadowmap, Doom Tournament

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by Enjay »

Fault noticed with Doom Tournament: viewtopic.php?f=43&t=60759

GZDoom 3.6.0 official and a git build from the 17th.
Release version of the mod and the development version.
My drivers are current. GeForce 1080 with driver version 416.34 released 11 October.

I've found a GZDoom setting that changes this. If Light Shadowmaps is set to "yes" I get the problem. If it's set to "no" the problem goes away.

Running around in MAP09 of Doom2 after picking up an Unreal Damage powerup (which creates a pink glow around the player), I noticed that things sometimes could go a bit screwy if I looked at the floor.

Should look like:


But sometimes looked like:

It's almost as if the light is z-fighting with the floor.

It's even easier to show on Doom E2M2. Just grab an unreal damage powerup (there should be one where the berserk pack usually is) then climb up on to some crates.



I have also noticed that the light flickers more than it should even if the major glitchiness shown above has not become apparent (a video shows this).
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by Enjay »

Update. The glitch does not seem to happen with a git build from 24th September. I'll see if I can track down the last git build that works.

[edit]
gzdoom-x64-g3.6pre-103-gd65d46226 from Oct 04 does not glitch (though it did crash the first time I tried to run it - but after that it was fine). All available git builds after this one glitch.
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by dpJudas »

The glitch most likely started after I changed the shadow map code. What interests me is more why this mod and why only on your computer.

Edit: I'm able to reproduce this on my computer as well.
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by dpJudas »

Okay I know partly what is going on here. It only happens when you pick up the amp. I suspect the amp is perfectly aligned with the floor. When you jump the effect goes away until you land again.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by Marisa the Magician »

Hm... maybe I screwed up the vertical offset of the light actor...
User avatar
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by Rachael »

Nice find with the crates. Now even I am able to reproduce it.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by Enjay »

For what it's worth, I've found another place where this is easy to show. This time it's not with Doom Tournament and it's not on the floor either.

Mod: Hocus Doom viewtopic.php?f=19&t=45804

First map at location shown in the screenshots.



and how it looks in 3.5.1 (i.e. like it's meant to)
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by dpJudas »

The glitch most likely happens when a dynamic light is placed in the same plane as the surface. In the second example you found the dynlight happens to be placed in exactly same plane as the ceiling.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by Enjay »

Yup, just been looking at the map setup and dynamic light myself. So, sort-of the same setup as with the Doom Tournament light being exactly on the floor. Perhaps my initial "it looks a bit like zfighting" might not be far off the mark? Could the shadowmap and dynamic light be doing something like zfighting with GZDoom trying to draw them on the same plane?

Anyway, in case it helps, I've made a similar setup and light definition to make it easy to find an area that displays the problem. With any luck, it should be visible to anyone trying to test it. Just load with Doom2. Nothing else needed.

[edit] Improved version showing the effect on the floor and the ceiling [/edit]
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by Marisa the Magician »

Heh, so it was my fault. The Damage Amp light has

Code: Select all

SetOrigin(target.pos,true);
in its Tick function. I must've forgotten to give it a Z offset.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by Enjay »

I think the answer is "kind of". It looks like any situation that puts a dynamic light on exactly the same plane as a flat with a shadow map on it will cause this to happen. So your mod does it and maybe the light should be raised up a little but it can just as easily happen with regular mapping and dynamic lights if the various positions are right for it (like the test map above).
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Visual Glitch - dyn lights, shadowmap, Doom Tournament

Post by Enjay »

In another thread entirely drfrag wrote:Today dpJudas has pushed a fix for it.
I just tried the devbuild from the 24th (today) and the issue does indeed seem to be fixed. Thanks. :)
Post Reply

Return to “Closed Bugs [GZDoom]”