[3.4.1] Cameratexture blacked out under some circumstances

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
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:

[3.4.1] Cameratexture blacked out under some circumstances

Post by Matt »

To replicate:

1. download the attached and DUMP 2

2. gzdoom -file <the attached mod> DUMP-2v2.pk3 -nomusic -noautoload

3. New game, mash enter until at map01

4. Go to Map08 using idclev08, map map08, or changemap map08

Expected: the cameratexture appears as on map01.
Actual: only one corner of the cameratexture appears, the rest blacked out.

Screenshots:
Spoiler:
Once it appears it never goes away, even if you start a new game, until you quit GZDoom.

This works fine in 3.3.2 and is bugged in 3.4.0.

If I break the ANIMDEFS reference in DUMP2, the HUD cameratexture works fine.

When the bug appears and I try to switch renderers, it persists.
Attachments
testctstatbar.zip
(1.28 KiB) Downloaded 56 times
User avatar
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: [3.4.1] Cameratexture blacked out under some circumstanc

Post by Matt »

The last pre-3.4 commit that I can confirm does not suffer this bug is 2ae8d39 from April 24.

The two that immediately follow it, 0dcc6ec and 8d62ebd, weren't tested because the first won't compile (something about a previously declared int) and the second would crash every time I tried to start a map, so I can't tell if either of them might be where this started, but c37ff22 is affected by this bug.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [3.4.1] Cameratexture blacked out under some circumstanc

Post by _mental_ »

It's started with c37ff22 exactly. The problem is with more than one camera textures of different widths/heights.
Simplified test case is in attachment. Works with arbitrary Doom map, just enter any level twice.
Spoiler: Code and screenshot
Attachments
camtex2.zip
(638 Bytes) Downloaded 88 times
User avatar
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: [3.4.1] Cameratexture blacked out under some circumstanc

Post by Matt »

Has anyone checked if this happens with cameratextures placed on a map as well?

(And does anyone know off the top of their head of any maps that employ multiple different-sized camera textures?)
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [3.4.1] Cameratexture blacked out under some circumstanc

Post by Enjay »

Matt wrote:Has anyone checked if this happens with cameratextures placed on a map as well?
It does, but it seems inconsistent. I saw the problem with a map a few days ago when I first read this report. I checked the map and one of the camera textures was half black. I've checked the map since and it wasn't showing the problem. I just checked again and still no problem, then I had an idea. The first time I saw the problem, I had come from the previous map (which has a number of camera textures), so I did that again and this time I got the problem on one camera texture:

it should look like...
Image

but looked like...
Image
(later, I repeated the test and this time it was a different camera texture that got messed up.)


Then I warped back to the first map and all the camera textures (which had previously been fine) were now messed up:
Image


Then warping back to the second map, things had got worse:
Image

The above are just test maps that I use for a variety of purposes; nothin' fancy.

Matt wrote:(And does anyone know off the top of their head of any maps that employ multiple different-sized camera textures?)
There is a chance something I have released does this because I quite often use a bunch of different sized camera textures, but I can't be certain of an example off the top of my head.
User avatar
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: [3.4.1] Cameratexture blacked out under some circumstanc

Post by Matt »

Well, at least we know it's the cameratextures and not something about how things are drawn on the HUD.

I would guess it's got something to do with a check for the bounding area of the cameratexture that was being done in FGLTexture but omitted in FHardwareTexture. I have no idea which of those it could possibly be though.

(I noticed that the old Bind calls both "Clean" and "CreateHwTexture" under the "texture has become invalid" block, but the new BindOrCreate function only has "Clean" in there. Is this at all related to the bug?)
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [3.4.1] Cameratexture blacked out under some circumstanc

Post by _mental_ »

HUD camera texture is broken in software renderer too but in a different way. It's not updated at all and remains black if GZDoom was started with software renderer.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [3.4.1] Cameratexture blacked out under some circumstanc

Post by Graf Zahl »

@Enjay: What map is that? Posting images of such a great testing example without a link to the map itself is really not nice. :(

That said, _Mental_'s demo map looks correctly for me with all builds I tested, starting from the commit this supposedly stated on, to 3.4.1 and today's WIP. And since I cannot reproduce the problem I need some help.
User avatar
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: [3.4.1] Cameratexture blacked out under some circumstanc

Post by phantombeta »

@Graf
Have you tried starting a new game after doing it once already or changing maps then checking again? It doesn't show immediately, you have to change maps at least once.
Here's a video demonstrating it:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [3.4.1] Cameratexture blacked out under some circumstanc

Post by Graf Zahl »

Fixed, I think. What puzzles me here is that the error only manifested itself now. I could trace it back to the actual implementation of framebuffer-based camera textures. Apparently some part of the older setup just happened to make it work with some buffer that was larger than the texture so it never glitched.

So it apparently was pure happenstance that nobody ever noticed it before.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [3.4.1] Cameratexture blacked out under some circumstanc

Post by Enjay »

Graf Zahl wrote:@Enjay: What map is that? Posting images of such a great testing example without a link to the map itself is really not nice. :(
It's actually not a great generalised testing map because it needs a particular set of custom resources to be loaded (mostly Return from Oblivion stuff + extras). Aside from the small number of camera textures, it's mostly for testing switches and animations in the mod.

Good to see the bug squished though. :)
User avatar
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: [3.4.1] Cameratexture blacked out under some circumstanc

Post by Matt »

Still not fixed as of 1ef9938. :(

EDIT: Tried 7817e6a directly to see if maybe a subsequent commit might've re-broken it. No such luck, still getting the corner on reload (and what I'm getting looks exactly like phantombeta's video except that blacked out area never turns to sky for me).
Last edited by Matt on Tue Jul 17, 2018 1:17 am, edited 1 time in total.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [3.4.1] Cameratexture blacked out under some circumstanc

Post by _mental_ »

For hardware renderer it was fixed in modern branch with commit 2c86c4e.
User avatar
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: [3.4.1] Cameratexture blacked out under some circumstanc

Post by Matt »

_mental_ wrote:For hardware renderer it was fixed in modern branch with commit 2c86c4e.
Confirmed fixed. Thanks!!!
Post Reply

Return to “Closed Bugs [GZDoom]”