Specific textures flickering in Void & Rainbow

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
RiboNucleic Asshat
Posts: 501
Joined: Thu May 09, 2013 8:15 pm
Preferred Pronouns: No Preference
Graphics Processor: nVidia with Vulkan support
Location: Exactly where I am
Contact:

Specific textures flickering in Void & Rainbow

Post by RiboNucleic Asshat »

Uncertain exactly what causes this. Certain textures with a custom shader applied to them are rendering very incorrectly in GZDoom 3.7.0 and up, but appear correct in 3.6.0.
This doesn't happen in any software renderer (since they don't use texture shaders...)

I've isolated the problem in a small test map (it's a bit shoddily put together but demonstrates the problem just fine)

Here's how the glitch looks, in 3.7.2:



Here's how it should look, in 3.6.0:


I am using an NVIDIA GPU on Windows 10. No other files are loaded besides those that come with gzdoom.

Here is the minimal test map:
test.pk3
(54.1 KiB) Downloaded 31 times
I tried looking to see if this had already been reported, but none of the existing reports seemed to describe the same problem and didn't show any issues when I tested them.
User avatar
phantombeta
Posts: 2088
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Specific textures flickering in Void & Rainbow

Post by phantombeta »

This seems to have something to do with the usage of "uObjectColor2" in the shader. Removing the "if" statement and leaving only "texelTest *= uObjectColor;" makes it work perfectly fine.
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: Specific textures flickering in Void & Rainbow

Post by Graf Zahl »

The problem actually looks to be glowdist.z.

No glow, no glowdist.z!
The code had to be changed a bit to implement Doom 64 lighting and what was glowdist is now two variables, i.e. glowdist and gradientdist, so that both features can be combined. This 'mix' instruction should use the newly added gradientdist which gets calculated for use with objectColor2.

Sorry, but this falls under 'can't fix'. It'd break a more recent engine feature if this was reverted. That's the risk you take when using undocumented features from the shader. In fact I can almost guarantee that this code won't survive the next refactoring of the shader anyway because the internal organization of these variables will change quite drastically, and possibly break lots of mods that poke around too deeply in engine internals.
User avatar
RiboNucleic Asshat
Posts: 501
Joined: Thu May 09, 2013 8:15 pm
Preferred Pronouns: No Preference
Graphics Processor: nVidia with Vulkan support
Location: Exactly where I am
Contact:

Re: Specific textures flickering in Void & Rainbow

Post by RiboNucleic Asshat »

Well, phantombeta's post prompted me to do more digging and I came to that exact conclusion. It causes issues no matter what 2 values are interpolated between. Is glowdist initialized to zeroes or is it never assigned?
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: Specific textures flickering in Void & Rainbow

Post by Graf Zahl »

If there are no glows it never gets assigned.
Post Reply

Return to “Closed Bugs [GZDoom]”