Crosshair transparency problem in GL2 renderer

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
armyman12345
Posts: 278
Joined: Mon Jun 24, 2013 11:39 am
Location: Jabba's Palace

Crosshair transparency problem in GL2 renderer

Post by armyman12345 »

While playing, there's a pure white square in the middle of the screen, it's obvious it's a graphical glitch. I am using Gzdoom 3.1, what's the cause?
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Weird problem in Project MSX

Post by _mental_ »

Works fine for me:
Screenshot_Doom_20170819_100757.jpg
Post a screenshot and your hardware spec, just in case it's something specific to particular configuration.
Mine was taken with GZDoom 3.1.0 and Project MSX Beta 2 (v0.2a) July 22, 2013 from this topic.
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: Weird problem in Project MSX

Post by phantombeta »

@_mental_
I imagine it might be the GL2 renderer bug where some crosshairs are drawn completely broken.
Will test something, then upload two screenshots showing the problem. (One being specifically what's probably the same thing the OP is seeing)
EDIT:
The problem seems to be with crosshairs that use black and white instead of transparency/alpha 0 and white.
I'm not sure, but it seems to be drawing them inverted, I think instead of interpreting black as alpha 0 and white as alpha 255, it's interpreting them the other way around.

You can see this problem in Guncaster

Insanity's Requiem

And Project MSX
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Weird problem in Project MSX

Post by _mental_ »

It's indeed an issue in legacy render path, i.e. with OpenGL 2.x renderer.
This topic needs to be moved to Bugs subforum and renamed accordingly.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Weird problem in Project MSX

Post by wildweasel »

_mental_ wrote:It's indeed an issue in legacy render path, i.e. with OpenGL 2.x renderer.
This topic needs to be moved to Bugs subforum and renamed accordingly.
Done
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Crosshair transparency problem in GL2 renderer

Post by _mental_ »

Thanks.

Interestingly enough it's already broken in 2.2.0 and I guess crosshairs were never displayed correctly in legacy renderer since both path merged.
And this was never reported before IIRC. /me thinking about obsolete hardware/software support requests :roll:
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: Crosshair transparency problem in GL2 renderer

Post by phantombeta »

Actually, this isn't just crosshairs. It seems pretty much anything that uses/can use black/white as alpha (For example, decals) is broken.
(Using actual alpha works fine, though, which is why the built-in crosshairs and decals don't look like the crosshairs in the screenshots I posted)
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Crosshair transparency problem in GL2 renderer

Post by _mental_ »

Actually such textures are also broken in software renderer for a long time. At least in ZDoom 2.8.1 they are displayed in the same way as in the legacy render path currently.
Is this hardware renderer only feature? Before switching off shaders completely for OpenGL 2.x cards it worked in both paths.
User avatar
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Crosshair transparency problem in GL2 renderer

Post by Rachael »

The truecolor renderer will respect the alpha channel of textures, at least if hardware acceleration is turned off. I am not 100% positive about on, but it should work just fine there, too.
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: Crosshair transparency problem in GL2 renderer

Post by Graf Zahl »

Can it be that they are missing the 'aLph' chunk? That would explain the problem in the software renderer, but for hardware it should not matter. I guess the problem is caused by not applying the alphatexture translation.
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: Crosshair transparency problem in GL2 renderer

Post by Graf Zahl »

The output is correct in both modern GL3 and hardware accelerated software 2D rendering.

It is not correct in GL2 and software 2D rendering.
The reason is that these textures are 24 bit grayscale textures.

Here's the problem: For both these modes the texture needs to be translated into an alpha texture - and that simply fails because the texture manager does not know how to do it.
Alpha textures that work correctly in all modes need proper setup:

1. They need to be 8 bit grayscale (not 24 and not 32 bit!)
2. They need an alPh chunk so that the texture manager knows that they are to be used as an alpha texture. (This is only needed for the software renderer.)

Since the problem only occurs in the two legacy render paths I am not going to throw more code at it as it'd be a very non-trivial fix. As time goes by all this stuff will sooner or later become unnecessary anyway while this hardware slowly disappears completely.
I think the only good this shows is that the market share of GL2 hardware isn't that high anymore, or more people would reported this long ago. :)
raikosen
Posts: 7
Joined: Sun Oct 15, 2017 7:23 pm

Re: Crosshair transparency problem in GL2 renderer

Post by raikosen »

hi everyone i'm new here but i have this problem as well and i'm wondering if this is somehow related to these problems as well

1) when using night vision googles torches flames turn into white squares

2) in project brutality and bd v20 bloodsteps are black squares with bloodprints in them

3) again in pb and bd v20 explosion marks are black squares

4) when using an addon called fog effect made by saegiru located in moddb some map sectors get totally dark on random movements and/or when there are items and ammo pick ups on rooms

i have a very old machine but works good for me, and no, i can't get another one right now, so if these problems are all related, does that mean they all can be fixed with the same code? they are not gamebreaking though but it would be nice to have a solution for them
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: Crosshair transparency problem in GL2 renderer

Post by Graf Zahl »

1) This is caused by badly defined graphics. Normally transparent parts are done by setting the alpha of that area to 0. But when using additive translucency just using black will look the same - unless the image gets inverted like the night vision effect does. This cannot be fixed in the engine, it will require a fix of the graphics themselves.

2 and 3) Essentially the same as 1) The graphics were not properly tested for their alpha channel settings.

To make it short. BD has always been a very sloppy product that contains lots of bugs both in its assets and script code.

4) I don't know. I have never seen that mod.
raikosen
Posts: 7
Joined: Sun Oct 15, 2017 7:23 pm

Re: Crosshair transparency problem in GL2 renderer

Post by raikosen »

so 1, 2 and 3 are game's problem, well i'll talk to developers for that

4) well here is a link to the addon in case you want to try it out, it worked ok for me until 2.4.x on 3.x i started to have these issues
Post Reply

Return to “Closed Bugs [GZDoom]”