Skip to content

Check game assets for linear colorspace compatibility #3395

@slipher

Description

@slipher

Any shader that uses blending (i.e. it has any stage where the blendfunc's DST (color buffer) contribution is not zero) may look different when using a linear colorspace rendering pipeline. So we should check all our game assets to make sure they look OK with linear blending. I've attempted to make a list of potentially affected non-map assets with the following procedure:

  • Load a map without any non-opaque surfaces (e.g. test-video)
  • Issue in the in-game console clear; listshaders; condump shaders.txt
  • In a terminal grep -P '^......[^2]........(?!OPAQUE.* 0:|DEPTH)' myhomepath/condump/shaders.txt | grep -vE 'gfx/binary|generatedTexture|HEATHAZEMAP|gfx/cgrading/| n/a |:fonts/'. The first grep command searches for any non-2D shaders that are either not sorted as OPAQUE or have more than one stage. The second, inverse grep command filters out some known false positives.

The same procedure should also be done for map shaders, for each map that will be released with sRGB-aware builds. That's out of the scope of this issue which is about players/buildables/weapons/etc.

---------------------------------------------------------------------------
num   regFlags shaderSort     stageType              stageNumber:shaderName
---------------------------------------------------------------------------
2     _____    FOG            FOGMAP                 0:<fogEqual>
3     _____    FOG            FOGMAP                 0:<fogLE>
6     _N___    BLEND0         COLORMAP               0:white
8     _____    BLEND0         COLORMAP               0:gfx/colors/white
67    _____    BLEND0         COLORMAP               0:gfx/outline
111   _____    DECAL          COLLAPSE_DIFFUSEMAP    0:gfx/buildables/creep/creep
115   _____    BLEND0         COLORMAP               0:gfx/weapons/tracer/tracer
117   _____    BLEND0         COLORMAP               0:gfx/buildables/common/greenbuild
118   _____    BLEND0         COLORMAP               0:gfx/buildables/common/yellowbuild
119   _____    BLEND0         COLORMAP               0:gfx/buildables/common/redbuild
120   _____    BLEND0         DIFFUSEMAP             0:gfx/buildables/human_base/spawning
120   _____    BLEND0         COLORMAP               1:gfx/buildables/human_base/spawning
139   _____    BLEND0         COLORMAP               0:gfx/feedback/chatballoon
140   ___S_    UNDERWATER     COLORMAP               0:gfx/feedback/bubble
142   _____    DECAL          COLORMAP               0:gfx/players/common/shadow
143   _____    DECAL          COLORMAP               0:gfx/players/common/wake
143   _____    DECAL          COLORMAP               1:gfx/players/common/wake
144   ___S_    BLEND0         COLORMAP               0:gfx/players/alien_base/green_acid
145   ___S_    BLEND0         COLORMAP               0:gfx/buildables/acid_tube/spore
146   ___S_    BLEND0         COLORMAP               0:gfx/buildables/booster/spore
147   ___S_    BLEND0         COLORMAP               0:gfx/players/human_base/jetpack_smoke
148   ___S_    BLEND0         COLORMAP               0:gfx/weapons/rifle/smoke
149   ___S_    BLEND0         COLORMAP               0:gfx/weapons/tracer/spark
150   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame00
151   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame01
152   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame02
153   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame03
154   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame04
155   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame05
156   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame06
157   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame07
158   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame08
159   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame09
160   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame10
161   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame11
162   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame12
163   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame13
164   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame14
165   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame15
166   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame16
167   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame17
168   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame18
169   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame19
170   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame20
171   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame21
172   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame22
173   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame23
174   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/flame/flame24
175   ____3    OPAQUE         COLORMAP               1:models/fx/metal_gibs/metal_gibs
176   _____    DECAL          COLORMAP               0:gfx/weapons/flamer/mark
177   _____    BLEND0         COLORMAP               0:gfx/weapons/grenade/puff
177   _____    BLEND0         COLORMAP               1:gfx/weapons/grenade/puff
177   _____    BLEND0         COLORMAP               2:gfx/weapons/grenade/puff
180   ___S_    BLEND0         COLORMAP               0:gfx/players/common/blood
181   ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/smoke
183   ___S_    NEAREST        COLORMAP               0:gfx/weapons/firebomb/fire
184   ____3    BLEND0         COLORMAP               0:models/generic/sphere
185   ____3    BLEND0         COLORMAP               0:models/generic/sphericalCone64
186   ____3    BLEND0         COLORMAP               0:models/generic/sphericalCone240
187   _____    BLEND0         COLORMAP               0:gfx/colors/plain
1747  ___S_    BLEND0         COLORMAP               0:gfx/weapons/blaster/bullet
1748  _____    DECAL          COLORMAP               0:gfx/weapons/blaster/mark
1749  ___S_    BLEND0         COLORMAP               0:gfx/weapons/blaster/impactspark
1750  ___S_    BLEND0         COLORMAP               0:gfx/weapons/prifle/flash
1751  _____    BLEND0         COLORMAP               0:gfx/weapons/prifle/trail
1752  _____    DECAL          COLORMAP               0:gfx/weapons/prifle/mark
1753  ___S_    BLEND0         COLORMAP               0:gfx/weapons/prifle/impact
1754  ___S_    BLEND0         COLORMAP               0:gfx/weapons/lcannon/bullet
1755  _____    BLEND0         COLORMAP               0:gfx/weapons/lcannon/fire
1756  _____    BLEND0         COLORMAP               0:gfx/weapons/lcannon/trail
1757  _____    DECAL          COLORMAP               0:gfx/weapons/lgun/mark
1758  ___S_    BLEND0         COLORMAP               0:gfx/weapons/lcannon/flare
1761  ___S_    BLEND0         COLORMAP               0:gfx/weapons/grenade/smoke
1762  ___S_    BLEND0         COLORMAP               0:gfx/weapons/grenade/flare
1763  ____3    BLEND0         COLLAPSE_DIFFUSEMAP    0:models/missiles/rocket/rocket
1764  ___S_    BLEND0         COLORMAP               0:models/weapons/hive/sprite1
1765  ___S_    BLEND0         COLORMAP               0:models/weapons/hive/sprite2
1767  ___S_    BLEND0         COLORMAP               0:gfx/weapons/level3upg/barb_splash
1768  _____    BLEND0         COLORMAP               0:gfx/weapons/rifle/smoke
1770  _____    DECAL          COLORMAP               0:gfx/weapons/rifle/mark
1797  ____3    BLEND0         COLORMAP               0:models/weapons/level2/zzap2
1798  ____3    BLEND0         COLORMAP               0:models/weapons/level2/zzap
1802  _____    DECAL          COLORMAP               0:gfx/weapons/level2upg/mark
1818  ___S_    BLEND0         COLORMAP               0:gfx/weapons/blaster/muzzleflash2
1819  ___S_    BLEND0         COLORMAP               0:gfx/weapons/blaster/muzzleflash1
1822  ____3    BLEND1         COLORMAP               0:models/weapons/rifle/flash
1826  _____    BLEND0         COLORMAP               0:gfx/weapons/rifle/puff
1826  _____    BLEND0         COLORMAP               1:gfx/weapons/rifle/puff
1826  _____    BLEND0         COLORMAP               2:gfx/weapons/rifle/puff
1827  ___S_    BLEND0         COLORMAP               0:gfx/weapons/rifle/verysmallrock
1830  ____3    BLEND1         COLORMAP               0:models/weapons/psaw/flash
1834  _____    BLEND0         COLORMAP               0:gfx/weapons/psaw/sparks
1840  _____    DECAL          COLORMAP               0:gfx/weapons/shotgun/mark
1841  ___S_    BLEND0         COLORMAP               0:gfx/weapons/rifle/flash
1843  ____3    BLEND0         COLORMAP               0:models/weapons/lgun/display
1848  ___S_    BLEND0         COLORMAP               0:gfx/weapons/lgun/spark1
1849  ___S_    BLEND0         COLORMAP               0:gfx/weapons/lgun/spark2
1850  ___S_    BLEND0         COLORMAP               0:gfx/weapons/lgun/spark3
1851  ___S_    BLEND0         COLORMAP               0:gfx/weapons/lgun/spark4
1852  ___S_    BLEND0         COLORMAP               0:gfx/weapons/lgun/spark5
1853  ___S_    BLEND0         COLORMAP               0:gfx/weapons/lgun/spark6
1854  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex01
1855  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex02
1856  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex03
1857  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex04
1858  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex05
1859  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex06
1860  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex07
1861  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex08
1862  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex09
1863  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex10
1864  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex11
1865  ___S_    BLEND1         COLORMAP               0:models/weapons/lgun/ex12
1873  ___S_    BLEND0         COLORMAP               0:gfx/weapons/mdriver/glow_particle1
1874  ___S_    BLEND0         COLORMAP               0:gfx/weapons/mdriver/glow_particle2
1875  ___S_    BLEND0         COLORMAP               0:gfx/weapons/mdriver/muzzleflash
1879  ____3    BLEND1         COLORMAP               0:models/weapons/chaingun/flash
1887  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch08
1888  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch09
1889  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch10
1890  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch11
1891  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch12
1892  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch13
1893  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch14
1894  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch15
1895  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch16
1896  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch17
1897  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch18
1898  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch19
1899  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch20
1900  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch21
1901  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch22
1902  ___S_    BLEND0         COLORMAP               0:gfx/weapons/flamer/torch/torch23
1906  ____3    BLEND0         COLORMAP               0:models/weapons/prifle/lense
1911  ___S_    BLEND0         COLORMAP               0:gfx/weapons/prifle/spiderflash
1917  ___S_    BLEND0         COLORMAP               0:models/buildables/mgturret/t_flash
1924  ____3    BLEND0         COLORMAP               0:gfx/null
1925  ____3    OPAQUE         COLORMAP               1:models/weapons/ckit/screen
1929  _____    BLEND0         COLORMAP               0:gfx/weapons/reactor/bolt
1929  _____    BLEND0         COLORMAP               1:gfx/weapons/reactor/bolt
1958  ____3    BLEND0         COLORMAP               0:models/buildables/telenode/effect
1968  ____3    OPAQUE         COLORMAP               1:models/buildables/arm/screen
1972  ____3    BLEND0         COLORMAP               0:models/buildables/medistat/scan
1972  ____3    BLEND0         COLORMAP               1:models/buildables/medistat/scan
1975  ____3    BLEND0         COLORMAP               0:models/buildables/medistat/cross
1975  ____3    BLEND0         COLORMAP               1:models/buildables/medistat/cross
1975  ____3    BLEND0         COLORMAP               2:models/buildables/medistat/cross
1975  ____3    BLEND0         COLORMAP               3:models/buildables/medistat/cross
1976  ____3    BLEND0         COLORMAP               0:models/buildables/medistat/display
1977  ____3    BLEND0         COLORMAP               0:models/buildables/medistat/displayU
1978  ____3    BLEND0         COLORMAP               0:models/buildables/medistat/displayD
1979  ____3    BLEND0         COLORMAP               0:models/buildables/medistat/displayH
1981  ____3    OPAQUE         COLORMAP               1:models/buildables/drill/drill
1981  ____3    OPAQUE         COLORMAP               2:models/buildables/drill/drill
1984  ____3    OPAQUE         COLORMAP               1:models/buildables/reactor/reactor_core
1986  ____3    OPAQUE         COLORMAP               1:models/buildables/reactor/reactor_arm
1986  ____3    OPAQUE         COLORMAP               2:models/buildables/reactor/reactor_arm
---------------------------------------------------------------------------
2029 total shaders, 2050 total stages, largest shader has 5 stages
---------------------------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions