Disabled Player Sprite causes Flickering Dynamic Lights

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
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Disabled Player Sprite causes Flickering Dynamic Lights

Post by Pixel Eater »

When the player sprite is hidden, the player is at a perfect position/angle/pitch and there are flickering dynamic lights nearby then some walls will light up immensely.

It's hard to capture because it's so fast but I've managed to luck out:


These were from the same pause, nothing changes except the cvar.

And here is a video
Spoiler: Saving here in case it's relevant
Spoiler: My specs
Last edited by Pixel Eater on Fri Feb 22, 2019 12:06 am, edited 1 time in total.
User avatar
Rachael
Posts: 13561
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by Rachael »

Make sure to state your hardware and full information about the current version of your operating system. Posting your "About This Mac" screenshot should be sufficient for that purpose. A startup log from GZDoom may be helpful for diagnosing your system's specific OpenGL implementation, since Apple's tends to be kinda crappy. You can add "+logfile ~/Desktop/GZDoom-startup.txt" to GZDoom's command line options for this purpose.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by Pixel Eater »

Okay thanks, I've added those into the first post :thumb:
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by _mental_ »

All this info is mostly useless without a map. In this case, a saved game is necessary too.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by Pixel Eater »

_mental_ wrote:All this info is mostly useless without a map. In this case, a saved game is necessary too.
I somehow managed to find another angle where it flashes darker instead so there are two saves included.
Still it's weird that it only happens when the sprite is hidden :shrug:

Google Drive
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by _mental_ »

Saved games must exactly match the map to be able to load them. That's what I've got with the provided sample

Code: Select all

This savegame needs these wads:
sladetemp_run.wad
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by Pixel Eater »

Ran this one outside of a Slade sesh so it should be ok: Link
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by _mental_ »

While I still cannot comprehend what's exactly wrong with it, I managed to narrow it down to a particular case.
It happens when two consecutive calls to FLightBuffer::DoBindUBO() with different indices lead to the same offset.

For example, for the provided test it's enough to use index instead of offset in conjunction with mLastMappedIndex in the given function.
One extra call to glBindBufferRange() "fixes" the flickering. But it doesn't give a clue about the real cause of this bug.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by Graf Zahl »

Does this only happen on Macs? Your analysis shows why I haven't seen thids yet: It seems to be part of the GL3 renderpath.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by _mental_ »

It’s GL3 render path but it’s not platform or hardware specific. Just force usage of UBO instead of SSBO and the bug will appear.
I tried to compare good and bad frames in RenderDoc. Uniforms are quite different and hard to compare directly. Like I said, good frames have an extra call to glBindBufferRange.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by _mental_ »

I think I found the problem. If I got everything right, mLastMappedIndex must be invalidated in FLightBuffer::BindBase() function as well.
As it does glBindBufferBase() under the hood, offset in FLightBuffer::DoBindUBO() may point to a wrong uniform array element (without rebinding a proper range).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by Graf Zahl »

Yes, I think you are correct here
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Disabled Player Sprite causes Flickering Dynamic Lights

Post by _mental_ »

Fixed in 087353f.
Post Reply

Return to “Closed Bugs [GZDoom]”