Crosshair transparency problem in GL2 renderer
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.
-
- Posts: 278
- Joined: Mon Jun 24, 2013 11:39 am
- Location: Jabba's Palace
Crosshair transparency problem in GL2 renderer
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?
-
-
- Posts: 3819
- Joined: Sun Aug 07, 2011 4:32 am
Re: Weird problem in Project MSX
Works fine for me:
Mine was taken with GZDoom 3.1.0 and Project MSX Beta 2 (v0.2a) July 22, 2013 from this topic.
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.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 2119
- 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
@_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
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
-
-
- Posts: 3819
- Joined: Sun Aug 07, 2011 4:32 am
Re: Weird problem in Project MSX
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.
This topic needs to be moved to Bugs subforum and renamed accordingly.
-
- 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
Re: Weird problem in Project MSX
Done_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.
-
-
- Posts: 3819
- Joined: Sun Aug 07, 2011 4:32 am
Re: Crosshair transparency problem in GL2 renderer
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
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
-
- Posts: 2119
- 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
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)
(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)
-
-
- Posts: 3819
- Joined: Sun Aug 07, 2011 4:32 am
Re: Crosshair transparency problem in GL2 renderer
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.
Is this hardware renderer only feature? Before switching off shaders completely for OpenGL 2.x cards it worked in both paths.
-
- Posts: 13797
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Crosshair transparency problem in GL2 renderer
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.
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Crosshair transparency problem in GL2 renderer
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.
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Crosshair transparency problem in GL2 renderer
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.
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.
-
- Posts: 7
- Joined: Sun Oct 15, 2017 7:23 pm
Re: Crosshair transparency problem in GL2 renderer
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
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
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Crosshair transparency problem in GL2 renderer
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.
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.
-
- Posts: 7
- Joined: Sun Oct 15, 2017 7:23 pm
Re: Crosshair transparency problem in GL2 renderer
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
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