HUD camera textures broken in GL2

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

HUD camera textures broken in GL2

Post by phantombeta »

Literally what it says in the title.
In 1.8 and 1.9 HUD camera textures work fine. In the latest dev build they don't, and appear as black.
I tested 1.8 and 1.9 both normally with my GPU and with this, just to be sure and stuff.
I dunno if the GL2 renderer is still supported, but this is a regression and some mods break without that, so this should be fixed. (IMO)

This can be seen with the Death's Head's altfire in Russian Overkill and with High Noon Drifter's blursphere replacement. (Sorry, I don't have any test WADs this time)
Weirdly enough, they work fine in Hideous Destructor.
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: HUD camera textures broken in GL2

Post by Graf Zahl »

Do the camera textures work in game?
The difference between 1.x and 2.x is where they get constructed. GZDoom 1.x renders them to the main screen and extracts a texture from there. This is a bad way to do things.
GZDoom 2.x renders them to a dedicated framebuffer and converts that into a texture. It may be that this feature is not properly supported on the affected hardware. If that is indeed the cause here you are out of luck, but it's something I cannot test.
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: HUD camera textures broken in GL2

Post by phantombeta »

Camera textures do work fine in walls, they just don't work in the HUD.
Mesa3D also renders both wall and HUD camera textures fine in 1.9, but renders HUD camera textures completely black in the current version of the GL2 renderer/legacy render path. (Same happens in actual hardware)
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: HUD camera textures broken in GL2

Post by Graf Zahl »

Do you have a test WAD?
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: HUD camera textures broken in GL2

Post by phantombeta »

Here it is.
While making this test WAD, I found something out. This bug only happens if the camera texture's resolution is higher than the currently set GZDoom resolution.
Specifically, if either the width or the height is higher, the bug happens. (Not 100% if it happens on higher heights, but definitely happens on higher widths, as 1152x864 causes it, even though it has a higher pixel count than 1280x720)

Steps to reproduce:
  • Run WAD
  • Change to a resolution lower than 1280x720
  • Use the switches
To unfreeze the player and remove the camera texture from the screen, press the jump button.
The first switch uses a camera on a camera texture without any actual texture, just the definition in ANIMDEFS. The second one has the texture defined in TEXTURES, and the third one has an actual image.

Also, while making this test WAD I found another bug. (Also GL2 only)
If you change resolutions while in a map, a bunch of stuff disappears. (The map geometry disappears, and most (non-HUD/menu) sprites disappear)
I'm not sure /what/ is going on with that. It also doesn't happen everywhere. For example, start Doom II MAP02 and do it, and it won't happen. However, turn 180 to face the wall behind you and do it and it happens. Turn 180 again to face where you were facing before, and it goes away.
Attachments
HUDCamTexTestWad.wad
(13.02 KiB) Downloaded 93 times
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: HUD camera textures broken in GL2

Post by Graf Zahl »

This will only happen if the camera texture is larger than the actual screen. The reason is that the legacy renderer cannot use the framebuffer implementation that's being used for modern OpenGL. If such a case is encountered the camera texture will not be rendered and left black.

Don't expect me to put any work into that render path. It will inevitably degrade further when it gets into the way of properly dealing with modern hardware.
Post Reply

Return to “Closed Bugs [GZDoom]”