[Can't fix] Crosshair transparency problem in GL2 renderer

Bugs that have been investigated and resolved somehow.

Moderators: Developers, ZDoom.org Team

Crosshair transparency problem in GL2 renderer

Postby armyman12345 » Fri Aug 18, 2017 10:57 pm

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?
User avatar
armyman12345
What the hell's regenerating health?
 
Joined: 24 Jun 2013
Location: Jabba's Palace

Re: Weird problem in Project MSX

Postby _mental_ » Sat Aug 19, 2017 2:16 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Weird problem in Project MSX

Postby phantombeta » Sat Aug 19, 2017 7:47 am

@_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
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland (BRASIL CARAI)
Discord: phantombeta#2461

Re: Weird problem in Project MSX

Postby _mental_ » Sat Aug 19, 2017 9:22 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Weird problem in Project MSX

Postby wildweasel » Sat Aug 19, 2017 9:24 am

_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
User avatar
wildweasel
I love the smell of sourdough in the morning
 
Joined: 15 Jul 2003
Location: avatar by kurashiki

Re: Crosshair transparency problem in GL2 renderer

Postby _mental_ » Sat Aug 19, 2017 9:45 am

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:
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Crosshair transparency problem in GL2 renderer

Postby phantombeta » Sat Aug 19, 2017 11:59 am

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)
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland (BRASIL CARAI)
Discord: phantombeta#2461

Re: Crosshair transparency problem in GL2 renderer

Postby _mental_ » Fri Aug 25, 2017 7:45 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Crosshair transparency problem in GL2 renderer

Postby Rachael » Fri Aug 25, 2017 7:52 am

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
Rachael
Not all elves needs a stocking hat...
 
Joined: 13 Jan 2004

Re: Crosshair transparency problem in GL2 renderer

Postby Graf Zahl » Fri Aug 25, 2017 7:53 am

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 Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Crosshair transparency problem in GL2 renderer

Postby Graf Zahl » Sun Aug 27, 2017 1:46 am

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. :)
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Crosshair transparency problem in GL2 renderer

Postby raikosen » Sun Oct 15, 2017 8:38 pm

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
raikosen
 
Joined: 15 Oct 2017

Re: Crosshair transparency problem in GL2 renderer

Postby Graf Zahl » Mon Oct 16, 2017 3:52 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Crosshair transparency problem in GL2 renderer

Postby raikosen » Mon Oct 16, 2017 10:35 am

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
raikosen
 
Joined: 15 Oct 2017


Return to Closed Bugs

Who is online

Users browsing this forum: Semrush [Bot] and 2 guests