Visual Glitch - dyn lights, shadowmap, Doom Tournament

Moderator: Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Visual Glitch - dyn lights, shadowmap, Doom Tournament

Postby Enjay » Fri Oct 19, 2018 12:07 pm

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
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Enjay » Fri Oct 19, 2018 12:19 pm

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby dpJudas » Fri Oct 19, 2018 12:30 pm

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
 
 
 
Joined: 28 May 2016

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

Postby dpJudas » Fri Oct 19, 2018 12:41 pm

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.
dpJudas
 
 
 
Joined: 28 May 2016

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

Postby Marisa Kirisame » Fri Oct 19, 2018 2:18 pm

Hm... maybe I screwed up the vertical offset of the light actor...
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

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

Postby Rachael » Fri Oct 19, 2018 3:27 pm

Nice find with the crates. Now even I am able to reproduce it.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

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

Postby Enjay » Sun Oct 21, 2018 3:26 pm

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)
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby dpJudas » Sun Oct 21, 2018 4:18 pm

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.
dpJudas
 
 
 
Joined: 28 May 2016

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

Postby Enjay » Sun Oct 21, 2018 4:39 pm

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]
Attachments
TestLight.pk3
(2.07 KiB) Downloaded 8 times
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Marisa Kirisame » Sun Oct 21, 2018 5:22 pm

Heh, so it was my fault. The Damage Amp light has
Code: Select allExpand view
SetOrigin(target.pos,true);
in its Tick function. I must've forgotten to give it a Z offset.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

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

Postby Enjay » Sun Oct 21, 2018 5:27 pm

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
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to OpenGL Renderer Bugs

Who is online

Users browsing this forum: No registered users and 1 guest