LUX

From Valve Developer Community
Revision as of 02:56, 17 October 2025 by ShiroDkxtro2 (talk | contribs) (Up-to-date Information about the Project)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)
LUX
Development.png In Closed Beta development
Wiki
TypeModification
DevelopersShiroDkxtro2
EngineSource Source
PlatformsPC PC ( Linux Linux (only in Source 2013 Multiplayer) )
Based onSource 2013 Source 2013
 
GitHub
Join Discord server

LUX LUX is a mod made for Source 2013 Singleplayer Source 2013 Singleplayer and Source 2013 Multiplayer Source 2013 Multiplayer.
The goal of the Project is a reevaluated and rewritten set of shaders, that are faster to compile, easier to debug and modify.
It resolves caveats and introduces new features, sometimes replicating those from newer source branches.
The shaders are not designed to boost performance, don't expect superficial increases in fps.

LUX can serve as a drop-in replacement to the shaders from Mapbase Mapbase.
Although it references Alien Swarm Code, the branch itself is not supported.
Similarly, macOS macOS is not supported.

LUX is based on publicly available code and has a strict no leaked-code policy.


Goals

  • Total Overhaul of the 🖿materialsystem\ folder
Implementing LUX LUX is intended to be as easy as possible. To ensure this, changes are restricted to the 🖿materialsystem\ folder.
Using Code from the Orange Box and Alien Swarm, 🖿materialsystem\shaderlib has been added back in and is used to implement new features.
Previously LUX was limited to the 🖿materialsystem\stdshaders folder. Now it's 🖿materialsystem\ to allow for this.
  • Faster compile times for all Shaders
All shaders have been rewritten from scratch and the systems they use have been reevaluated.
Due to this, all shaders in the project can be compiled in about 15 minutes on dated hardware.
For newer Hardware ( r9 5950x ), you may see times as low as two minutes.
Various shaders now have their own .bat scripts. Making it easier to develop individual shaders.
This means modding specific shaders ( such as VertexLitGeneric ) is much faster.
Now changing a header does not mean having to 'recompile the universe'
LUX LUX intends to serve as a drop-in replacement for Mapbase Shaders
Thus it has features such as Parallax Corrected Cubemaps ( and much more.. radial fog, non-location specific Core Shader, .. )
To facilitate this, every SDK_ Prefixed Shader will fallback to LUX_
  • Stock Shader replacement
LUX LUX allows for the selective replacement of existing shaders on Source 2013 Multiplayer Source 2013 Multiplayer.
Using Various other methods such as memory patching or material passthrough this may also be used on Source 2013 Singleplayer Source 2013 Singleplayer
  • Shadermodel 3.0 only
To allow for many of the new features, all of the Shaders use Shadermodel 3.0.
A limitation created by this is that Linux on Source 2013 Singleplayer Source 2013 Singleplayer cannot run LUX, since ToGL does not have support for it,
DXVK may serve as an alternative here for Linux Users.
SM3.0 released in 2004, and Valve considered ps2.0b low end hardware in ~2008. See slide 8
This means that older hardware not capable of SM3.0 will not be able to use the new Shaders either.
  • Drastically more documentation, including their parameters, how they work and any possible caveats
Due to the Development of LUX LUX, Articles on the VDC such as $lightwarptexture, $detail, UnlitTwoTexture and $envmapmask
received massive updates, filling them with information about caveats and bugs.
LUX shaders themselves have many comments, notifying when the behaviour of stock shaders has to be considered to keep visual consistency.
A Github Wiki listing all shader parameters and all shaders in the project is in the works.
Helper strings have been added to all parameters and can be read back via the in-game console as well.
This includes old features such as $selfillumtexture and newer features like $phongalbedoboost(only in Counter-Strike: Global Offensive).
Note that LUX is not made from leaked code. Features (such as $SSBumpMathFix) have been derived from visual research in branches with them present and logical conclusions.
  • Fixing parameter caveats when they don't break visual consistency.
Dozens of broken parameter combinations are fixed with LUX.
LUX has a habit of magically fixing things we didn't even know were broken on stock.
If there is a broken combination or a caveat that isn't fixed, make a github issue ( please check if it's broken on LUX first )

Features

Some Features from these Branches have been implemented:

Note.pngNote:Code from Alien Swarm engine branch Alien Swarm engine branch is heavily adapted, cross-referencing may be difficult.
Warning.pngWarning:Features that couldn't be made with code reference will be prone to visual disparity.

Features that aren't planned to be supported

Resolved Caveats

  • $bumpmap + $envmapmask. Used to be (only in Counter-Strike: Global Offensive) and (only in Mapbase)
  • $detailblendmode 0-9 and 11 now supported on VertexLitGeneric, LightmappedGeneric and WorldVertexTransition
  • $detailblendmode 10 now supports $SSBump. (only in Portal 2)
  • $lightwarptexture + $detail. Doesn't work in Team Fortress 2 and Alien Swarm
  • $basealphaenvmapmask + bumpmap now supported on VertexLitGeneric.
  • $blendtintbybasealpha for LightmappedGeneric and WorldVertexTransition.
  • $selfillummask now supported on some Shaders that didn't have it previously.
  • For Main Shaders, all Transform Parameters can now work unattached to one another.
  • WVT Now supports separate Transforms for: Base, Base2, Bump, Bump2, Detail, Detail2, EnvMapMask, EnvMapMask2, BlendModulate
  • EnvMapMasks can now manually be flipped using $EnvMapMaskFlip. This is also used to reproduce stock behaviours.
  • $selfillum_envmapmask_alpha previously not on some main shaders in (not in Source 2013)
  • $invertphongmaskAlien SwarmSource 2013 flips only the EnvMapMask on Stock. LUX solves this with $PhongNewBehaviour.
  • $phongalbedotint can now be used without $phongexponenttexture.
  • $phongalbedoboost(only in Counter-Strike: Global Offensive) and $detail can now be used together.
  • $phongtint does not disable $phongalbedotint anymore.
  • $PhongFlatNormal introduced to override $basemapalphaphongmask behaviour of forcing a flat normal. ( Disabling the Normal Map )
  • Many Phong Issues have been resolved. To keep visual consistency with stock shaders, $PhongNewBehaviour has been introduced that disables broken behaviours.
  • $lightwarptexture can now be used on VertexLitGeneric without forcing BumpMapping, using $LightWarpNoBump.
  • $detailblendmode 5 and 6 on $BumpMap'd VertexLitGeneric.
  • .. Many.. MANY more Issues have been resolved. Simply too many to list here.

History

LUX LUX started development on January 20th, 2023. Plans for it were made around January 14th.
Even before 2023, the idea of rewriting Valve's shaders was being considered, due to constant modification requests.
Requests are most commonly denied due to stock shader limitations, artificial complexity and long development times.

See also

Development can be followed here.
It is also intended as a general place for discussing source related Shader-Modding.
For Bug-Reports & Suggestions.
The public repository that will hold the code once the project releases.