2019-01-23 14:22 EST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001842FSSCPgraphicspublic2017-06-19 21:19
Assigned ToZacam 
StatusclosedResolutionwon't fix 
Product Version3.6.9 
Target VersionFixed in Version 
Summary0001842: Shine maps without alpha default to 'mirror'
DescriptionIt's standard practice now to give every shine map an alpha channel to control the environment mapping. Unfortunately not everyone does this; in particular, older mods with shine maps released before environment mapping can be really distracting.

Can we change the behavior so when a shine map doesn't have an alpha channel, it defaults to no environment mapping instead of full environment mapping? This would help to make the alpha channel 'optional' instead of 'required' on ships that don't really use environment mapping (like most missiles) and save on memory usage.
TagsNo tags attached.
Attached Files
  • rar file icon maps.rar (1,334,187 bytes) 2009-03-16 14:18




karajorma (administrator)


It would be nice to fix this before 3.6.10.


ARSPR (reporter)

Last edited: 2009-03-16 14:43

Er... Galemp I cannot replicate this issue.

When a shine map doesn't have alpha, the env amount is calculated through shine RGB channel values somehow (you should ask Taylor about the exact way).

But you never get the full mirror effect.

I upload two Aeolus-HLT-Shine maps modified from Mediavps 3.6.10 dds one. They are just tga without mipmaps, one without alpha channel and the other with a full white alpha (just rename the extension). You can check how different they look in the F3 lab.


I wanted to test it because just the last week, I was involved in some conversation about it:


KeldorKatarn (reporter)

I don't know what the fixed function pipeline code does, but the MediaVP shaders simply use the rgb value of the shine map as alpha, meaning the brightness of the color determines reflectivity.

At least for GLSL code this can easily be "fixed" by changing the shader code. For Fixed Function Pipeline I think this is working as designed. Simply add a black alpha channel to the shine map. A DDS file compression with 1bit alpha is already enough for that.


ARSPR (reporter)

I suppose this is more a feature/behaviour change request between:

+ (What Taylor designed), what is implemented in MVP 3.6.10. shaders: If shine map has no alpha, the env effect is determined by RGB-derived brightness.

+ What Galemp & Keldor prefer. If no alpha is present, there's no env.

(Nevertheless, at least with shaders, I suppose that some Open GLSL coder could post "alternative" shaders with this behaviour).


Zacam (administrator)

Last edited: 2009-03-25 03:20

Shaders will not accomplish having no ENV if there is no alpha, There will have to be code to set a "pretend" all black in the event of no actual Alpha channel.

Running with -no_glsl has the same effect, just at a significantly reduced amount as you find with shaders enabled.

Setting ENV to not load RGB results in the same as having an all white alpha channel,

I could mitigate the applied values to try and reduce the reflectivity of the result, but it will likely also impact the results for when a proper alpha channel exists.

But frankly, rather than abuse the code to compensate for poor skills or old data, educate the error out of existence and help promote good texture handling behaviours when you encounter missing alpha channels in shine maps, even if ENV is not going to be used in a mod, and promote the community spirit by having swamped people post up work that needs to be converted to help an existing mod stay current.


chief1983 (administrator)

There _has_ been a way to produce the mirror effect, I'm not sure of the details but I believe the Lucifer and the Triton freighter in the MediaVPs 3.6.8z suffered from this issue. So however they were set up, that's how you produce the mirror effect. That was one of the biggest problems the old MediaVPs had with the newer code (fixed at least, perhaps shader as well).


Zacam (administrator)

Chief: To produce a mirror effect is simple by any one of 3 ways.

1: Too bright of a saturation on the alpha channel.

2: An all white Alpha Channel (Mirror Syndrome of D00M!)

3: Having no alpha channel, in which some elements (based on the RGB of the shine map) have a significantly more pronounced shine to them than may be intended.

The difference between 3.6.8/9 and 3.6.10, is that, while it is not Mirror Syndrome of D00M! bright, when there is no alpha channel, under the shaders system the specularity for those RGB areas is even more pronounced than it is under Fixed Render or -no_glsl.

The question is wether or not this additional difference can be compensated for with the shaders, hence my prior note.

It may be possible, but it will impact the rendering of both Spec and Env. While this is not necessarily a bad thing, the only method I see is regulating Shine and Env to Fixed Render function in a way that still allows Normal and Height Maps. This is possible, but may not be desired.

Additionally, the request is to have it act as if ENV is not an option if there is no alpha channel on the -shine. This will (at my current experience) require code more than shaders, or will require actually adding appropriate Alpha channels to those files.

As far as saving on memory: Adding a solid black alpha channel to a ship or missile texture file will save significantly more in terms of convolutions in the code and possible performance impact (especially when mixed with maps that do and maps that don't) than trying to code and set a subset of shaders to handle the unexpected lack.

Shine/Env maps _are_ entirely optional. To the extent that in order to have ENV, you have to have something in an Alpha Channel in a file called $model$-shine. If you do not want env, make it solid black. Or, don't make a shine map.

What _I_ would like to see, is the ability to have ENV even if no -shine file exists so that the two are not dependent on each other. At this point, whether an alpha channel exists or not will be irrelevant. If layered DDS comes around the corner soon, it may become irrelevant then.


Zacam (administrator)

As suspected (confirmed by Valathil most recently) the amount of effort involved to try and "fix" this problem (which isn't a code one to begin with but a content one) does not really make it feasible to accomplish without potentially introducing more problems than it is worth.

As well, the shaders used in the engine now have come a long way since then, and so has content and content creation.

Going with the philosophy of educating people into making better assets as a resolution.


Goober5000 (administrator)

It was mentioned that the github issue https://github.com/scp-fs2open/fs2open.github.com/pull/1271 could be related to this Mantis ticket.

-Issue History
Date Modified Username Field Change
2008-12-10 08:24 Galemp New Issue
2009-03-15 12:54 karajorma Note Added: 0010739
2009-03-16 14:16 ARSPR Note Added: 0010742
2009-03-16 14:18 ARSPR File Added: maps.rar
2009-03-16 14:35 ARSPR Note Edited: 0010742
2009-03-16 14:43 ARSPR Note Edited: 0010742
2009-03-23 18:35 KeldorKatarn Note Added: 0010756
2009-03-24 15:31 ARSPR Note Added: 0010762
2009-03-24 22:45 Zacam Note Added: 0010763
2009-03-24 22:47 Zacam Note Edited: 0010763
2009-03-25 03:18 Zacam Note Edited: 0010763
2009-03-25 03:20 Zacam Note Edited: 0010763
2009-03-25 11:55 chief1983 Note Added: 0010767
2009-03-26 01:21 Zacam Note Added: 0010772
2012-01-20 23:32 Zacam Note Added: 0013087
2012-01-20 23:32 Zacam Assigned To => Zacam
2012-01-20 23:32 Zacam Status new => resolved
2012-01-20 23:32 Zacam Resolution open => won't fix
2012-01-22 12:26 chief1983 Status resolved => closed
2017-06-19 21:19 Goober5000 Note Added: 0016900
+Issue History