Hard Light Productions Forums

Hosted Projects - FS2 Required => Blue Planet => Topic started by: Lykurgos88 on December 24, 2015, 01:48:34 pm

Title: Green Narayana in game?
Post by: Lykurgos88 on December 24, 2015, 01:48:34 pm
Hi,

I finally decided to take some time to organize this post. Yes, there is a graphical bug in my new Blue Planet installation and it only concerns the Narayana frigate. It seems that there is something wrong with its shader. As a default in the tech room, it shows up as "blue" and in-game is shows as completely "green" (probably combination of yellow from the sun and blue). So far, Narayana is the only ship with this shader bug, and there are no errors when running the debug build.

This is how it looks in the tech room:

(http://koti.mbnet.fi/olzie/Moebius/FSO_bughunt/Narayana/Narayana_blue.png)

In the previous Blue Planet installation it looked "normal".

This is how it looks in-game (screenshot taken from massive battle, but it still looks green in every other mission too):

(http://koti.mbnet.fi/olzie/Moebius/FSO_bughunt/Narayana/Narayana_green.png)

Attention! It still looks green even if there are no beams around. Every other GTVA and UEF ship looks normal when there is no action.

I'm using the latest Blue planet files, latest drivers for Geforce Gtx 780 and the latest nightly build for FSO. Log file where I look around in tech room is attached in the post.

[attachment DELETED!! by Strong Bad]
Title: Re: Green Narayana in game?
Post by: MatthTheGeek on December 24, 2015, 02:55:27 pm
This sounds like an issue with team colors. Do other UEF capships have this issue?
Title: Re: Green Narayana in game?
Post by: DahBlount on December 24, 2015, 02:59:36 pm
I get this as well and yes, the Karuna and Solaris also have this issue. It's specifically an issue with team color glows. For some reason FSO thinks there is an alpha channel even though there isn't. I'm currently looking into it.

Edit: It appears to only be an issue with DXT1. Taking a further look into the code to see how it treats that compression format.
Title: Re: Green Narayana in game?
Post by: Maverick_BB110CB on December 30, 2015, 05:36:13 am
I have the same issue. But mine never turns green, it's always blue. And it only affects the Narayana, not the Karuna and Solaris for me.

I first noticed this on the Masyaf - it looked OK in the ending scene of Act 2 and tan it became blue in the Dreamscape. Well, since it's dreamscape I thought that it's supposed to look that way  :)

Now I realized that I switched the build between acts 2 and 3. So I tested it and the thing happened somewhere between builds e36e9ff and 7badc4d.
Title: Re: Green Narayana in game?
Post by: niffiwan on December 30, 2015, 05:44:25 am
One (http://9cc70790c9b063241fc6349f248bd513772a68eb) of (http://7d392bd61c093997afaa819a3552768807df14ff) these (http://1552e02a5184636f37c9933a7167701e6b5b51b5) probably.

...For some reason FSO thinks there is an alpha channel even though there isn't. I'm currently looking into it.

This little sucker (https://github.com/scp-fs2open/fs2open.github.com/blob/master/code/bmpman/bmpman.cpp#L804) thinks that anything with 32 bits-per-pixel has an alpha channel (except PCX files, but not relevant here). If team colour glows are now using (& saving?) the alpha channel of the -misc texture could that be tripping FSO up (although I must admit that I can't see how changing the shader would affect whatever might be calling that function?)

Title: Re: Green Narayana in game?
Post by: DahBlount on December 30, 2015, 10:35:17 am
Hmm, so bm_has_alpha_channel() only assumes PCX files don't have alpha channels? That's a little odd considering DXT1 has no explicit or interpolated alpha unless you export it with 1 bit alpha (where 0 is black, 1 is white, it can only be one or the other, no value in between). In fact, it's not always 24(25)-bits in depth, since it can be either 4 bpp or 8 bpp depending on the export options. With this, only DXT3 and DXT5 will allow us to make the alpha channel 0 so as to avoid this issue. If you need a fix for right now, just put these (https://drive.google.com/file/d/0B-rjVIFb4gQVb2NrZkFjMXNYVE0/view?usp=sharing) into your bpcomplete/data folder.
Title: Re: Green Narayana in game?
Post by: niffiwan on December 30, 2015, 03:44:37 pm
After I slept on it I think that bm_has_alpha_channel() is probably irrelevant.  However, if a DXT1 map (without alpha) is "passed" to the team colours shader, what is the shader going to treat the alpha value as being? i.e. what's the default?  Prior to the changes that didn't matter since only the red/green channels were used.  Maybe the fix is as simple as changing the shaders (or the shaders input) default to be fully opaque (or whatever the map needs to be in order for there to be no team colour displaying)
Title: Re: Green Narayana in game?
Post by: niffiwan on January 03, 2016, 05:26:29 am
FYI, Swifty has fixed this issue (https://github.com/scp-fs2open/fs2open.github.com/pull/509), and the fix should be in the next nightly.
Title: Re: Green Narayana in game?
Post by: Lykurgos88 on January 06, 2016, 01:35:02 pm
I tested the new nightly and can confirm, it's fixed. Thank you very much =)