[4.2.4] Sprites far away get drawn over closer sprites
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.
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.
[4.2.4] Sprites far away get drawn over closer sprites
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)
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)
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [4.2.4] Sprites far away get drawn over closer sprites
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...
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...
Re: [4.2.4] Sprites far away get drawn over closer sprites
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)
https://cdn.discordapp.com/attachments/ ... 160154.png
https://cdn.discordapp.com/attachments/ ... -26-21.mp4 (will download the vid)
- phantombeta
- Posts: 2084
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: [4.2.4] Sprites far away get drawn over closer sprites
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)
(Funnily enough, also with Hideous Destructor. Not with UG and TVR!, though, I was playing with Alfonzone and a Hideous Destructor weapons addon)
- sinisterseed
- Posts: 1349
- Joined: Tue Nov 05, 2019 6:48 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: [4.2.4] Sprites far away get drawn over closer sprites
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
viewtopic.php?f=7&t=66901
Some sprites/decals can be seen through walls: https://i.imgur.com/4EEY3To.png
- phantombeta
- Posts: 2084
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: [4.2.4] Sprites far away get drawn over closer sprites
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.
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [4.2.4] Sprites far away get drawn over closer sprites
Please post your INI. Something must be different from mine, as I've never seen this effect.
- phantombeta
- Posts: 2084
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: [4.2.4] Sprites far away get drawn over closer sprites
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 28 times
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [4.2.4] Sprites far away get drawn over closer sprites
I think gl_sprite_blend is the culprit here. If you see it again, can you try to toggle that CVAR?
Re: [4.2.4] Sprites far away get drawn over closer sprites
OP here. gl_sprite_blend doesn't help. In fact, it doesn't even do anything noticeable. Tested only on Vulkan, though.
- phantombeta
- Posts: 2084
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: [4.2.4] Sprites far away get drawn over closer sprites
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.
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.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: [4.2.4] Sprites far away get drawn over closer sprites
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.
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.
Re: [4.2.4] Sprites far away get drawn over closer sprites
Went back as far as GZDoom 3.4.0 and the bug is still present in that version.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: [4.2.4] Sprites far away get drawn over closer sprites
Here's a zscript lump that can be used to test this.
This is the entire lump, just copypaste.
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.
This is the entire lump, just copypaste.
Code: Select all
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;
}
}
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.
-
- Posts: 800
- Joined: Thu Apr 25, 2013 12:21 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
- Graphics Processor: nVidia with Vulkan support
- Location: The Corn Fields
- Contact:
Re: [4.2.4] Sprites far away get drawn over closer sprites
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.
However this made me think otherwise.