[Fixed] [4.2.4] Sprites far away get drawn over closer sprites

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

[4.2.4] Sprites far away get drawn over closer sprites

Postby Thomas Murdforth » Sun Dec 29, 2019 9:13 am

Tested on both 4.2.4 and gzdoom-x64-g4.3pre-568-g77469e051 (latest dev build as of this post). It happens in both Vulkan and OpenGL. Hell, it happens even in SoftPoly, for what it's worth.

There is a way to see this for yourselves. I'll attach save file below. You'll need the following files:

TVR!: https://www.doomworld.com/idgames/level ... gawads/tvr
Universal Gibs: https://gitlab.com/accensi/UniversalGib ... master.zip
Hideous Destructor 4.2.4b: https://github.com/MatthewTheGlutton/Hi ... 4.2.4b.pk7
Save game & screenshots: https://drive.google.com/open?id=1mm405 ... 42qHIm0sSd
Listed in load order, although it doesn't seem to matter.

I haven't tried to reproduce in vanilla. Not sure how to reproduce it at all. It just randomly happens, usually later in the level when there are a lot of sprites (Universal Gibs probably helps trigger it). At least it persists when it happens, and between save game loading or restarting GZDoom.
It should be visible right after loading the save, just above the cursor. See screenshots, too. If you look left and right you can see the issue disappear. It only happens under certain angles. The blood consists of flatsprites, for the record, but I have seen this happen with regular sprites as well, so it's definitely not tied only to the former.

Specs:
Windows 10 Pro, x64
Nvidia GTX 1080 (updated drivers last week; problem has been present for a while and that did not help)
Thomas Murdforth
 

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby Graf Zahl » Sun Dec 29, 2019 10:27 am

From the looks of it this is caused by the translucent flat sprites in the Universal Gibs mod. This feature is unfortunately a little bit broken and without a significant feature regression it's not fixable.

The current flat and wall sprite implentations need to be gutted and replaced with something that is actuallly manageable by the renderer, but I think you can imagine how that will work out...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby Thomas Murdforth » Sun Dec 29, 2019 11:24 am

I mentioned in the OP that I have seen this happen with non-flatsprite actors as well. I clearly remember a regular grass sprite being visible through a chaingunner's foot when the grass was at least 500 map units away. See link below. This happened on one of Hell on Earth Starter Pack's maps. Another time, with flatsprites, I encountered flickering between normal and broken rendering, despite not moving or looking around. See 2nd link. I know about the usual problem with translucent flat sprites, but this is recent. I don't recall seeing it prior to 4.2.0, far as I can remember at least.

https://cdn.discordapp.com/attachments/ ... 160154.png
https://cdn.discordapp.com/attachments/ ... -26-21.mp4 (will download the vid)
Thomas Murdforth
 

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby phantombeta » Fri Jan 17, 2020 3:24 am

This definitely should be looked into. It's not just flatsprites, as you can see from the screenshot in the last post. I've also encountered this myself too with a pickup and a dead monster that definitely weren't flatsprites.
(Funnily enough, also with Hideous Destructor. Not with UG and TVR!, though, I was playing with Alfonzone and a Hideous Destructor weapons addon)
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
Global Moderator
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby lowskill. » Mon Jan 20, 2020 6:15 am

Looking at the image in the first link above phantom's post, is that related to the second issue I reported here, but which was seemingly omitted (admittedly I should've probably made another topic for it to not get lost)?

viewtopic.php?f=7&t=66901

Some sprites/decals can be seen through walls: https://i.imgur.com/4EEY3To.png
User avatar
lowskill.
GZDoom RO Translator & Raze Tester
Global Moderator
 
Joined: 05 Nov 2019
Twitch ID: sixhundredsixteen
Github ID: sinisterseed
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby phantombeta » Sat Jan 25, 2020 10:29 am

I just had the bug again just now, also with HD. Some tree sprites (which are fully opaque) briefly got screwed up sorting, with some trees appearing in front of others when they shouldn't. The scene where it happened is depicted in the screenshot below:

However, in this case, they suddenly got correct depth sorting back. I'm guessing something somewhere is not setting state correctly, and transparent sprites are messing up depth culling for opaque ones.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
Global Moderator
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby Graf Zahl » Sat Jan 25, 2020 10:46 am

Please post your INI. Something must be different from mine, as I've never seen this effect.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby phantombeta » Sat Jan 25, 2020 10:53 am

Here you go. Maybe it has to do with the specific transparency settings of the surrounding actors, too.
Attachments
gzdoom-Chronos.ini
(114.71 KiB) Downloaded 14 times
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
Global Moderator
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby Graf Zahl » Sat Jan 25, 2020 11:06 am

I think gl_sprite_blend is the culprit here. If you see it again, can you try to toggle that CVAR?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby Accensus » Thu Feb 13, 2020 4:14 pm

OP here. gl_sprite_blend doesn't help. In fact, it doesn't even do anything noticeable. Tested only on Vulkan, though.
Accensus
Global Moderator
 
Joined: 11 Feb 2016

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby phantombeta » Fri Feb 14, 2020 4:17 pm

After some testing, it turns out the rocket grenade from Hideous Destructor practically always triggers this. If one explodes in a sector with a sky ceiling, sprites will be sorted wrong as fuck for a while.


It seems to be related to HD's "bullets can fly into the sky" thing. It happens with bullets too, although it's slightly harder to have it happen long enough for you to shoot the bullets into the sky, then be able to look down and see the glitch.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
Global Moderator
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby Matt » Fri Feb 14, 2020 4:26 pm

More specifically, HD's bullets are calling SetOrigin with interpolation to move the bullet actor "above" the ceiling, often well above 35000.

This has been changed as of this commit, relying instead on a vector3 that tracks the "real" position of the bullet.
I have been advised that this change does not mitigate the bug in any way whatsoever.
User avatar
Matt
Putting the XD into *xdeath since 2007
Global Moderator
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby Accensus » Fri Feb 14, 2020 6:15 pm

Went back as far as GZDoom 3.4.0 and the bug is still present in that version.
Accensus
Global Moderator
 
Joined: 11 Feb 2016

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby Matt » Fri Feb 14, 2020 8:14 pm

Here's a zscript lump that can be used to test this.

This is the entire lump, just copypaste.
Code: Select allExpand view
class wbbb:weapon{
    default{weapon.slotnumber 1;}
    states{
    ready:
        TNT1 A 1 A_WeaponReady();
        wait;
    select:
        TNT1 A 0 A_Raise();
        wait;
    deselect:
        TNT1 A 0 A_Lower();
        wait;
    fire:
        TNT1 A 0{
            for(int i=0;i<100;i++){
                let aaa=spawn("hdbbbb",pos);aaa.vel=(frandom(-1000,1000),frandom(-1000,1000),frandom(0,40));
            }
        }
        TNT1 A 1 A_Refire();
        goto ready;
    hold:
        TNT1 A 1;
        TNT1 A 1 A_Refire();
        goto ready;
    }
}
class hdbbbb:actor{
    override void tick(){
        setorigin(pos+vel,true);
    }
    states{
    spawn:
        BAL1 A -1;
    }


To test:

1. Summon a gazillion decorations scattered about in one area so you get lots of overlapping sprites. (EDIT: it may be necessary to do this under sky EDIT2: it is not, but it might be more effective or at least noticeable to have a variety of actors overlapping each other)
2. Give "wbbb" and fire it, then look around.
3. Repeat 2 as necessary.

Expected: the balls just fly off in random directions and nothing else happens.
Actual: after a few seconds or so your decorations start getting drawn in the wrong order.
Last edited by Matt on Sat Feb 15, 2020 2:27 am, edited 2 times in total.
User avatar
Matt
Putting the XD into *xdeath since 2007
Global Moderator
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [4.2.4] Sprites far away get drawn over closer sprites

Postby SanyaWaffles » Sat Feb 15, 2020 2:07 am

I've been noticing this bug similarly with +FLATSPRITE but assumed that was because FLATSPRITE is a bit weird.

However this made me think otherwise.
User avatar
SanyaWaffles
Navy Did Nothing Wrong
Global Moderator
 
Joined: 25 Apr 2013
Location: Eastern Ohio
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Next

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests