LUX

From Valve Developer Community
Revision as of 10:15, 19 February 2023 by Roman memes (talk | contribs) (ModernNote everywhere)
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)
LUX
Development.png In Alpha development
Wiki
TypeModification
DevelopersShiroDkxtro2
EngineSource Source
Platforms(only in PC)
Based onSource 2013 Source 2013
 
GitHub
Join Discord server

LUX is a mod specifically made and developed for use in Source 2013 Singleplayer Source 2013 Singleplayer and Source 2013 Multiplayer Source 2013 Multiplayer.
The Project is to entirely rewrite all existing "SDK_" Shaders, that come with the SDK and all those available in Mapbase Mapbase.

Goals

  • Overhauled/Cleaned materialsystem\stdshaders\ Folder
Template:ModernWarning
Template:ModernNote
Note.pngNote: Implementing LUX Shaders would entail replacing the existing stdshaders\ with the one from LUX. Effectively 'nuking' SDK_ Shaders. LUX Shaders should be able to do everything SDK_ Shaders in Source 2013 and Mapbase can do.


  • Drastically decreased compile-times for all Shaders
Why?: Valves Shaders take forever to compile Source 2013 SingleplayerSource 2013 MultiplayerAlien Swarm. Especially using the stock Shader-Compiler. This disincentives modding the Shaders.
Note.pngNote:Even on a good CPU it can take half a day, or more. As an example for LUX. Compiling the entirety of LUX_LightMappedGeneric takes around 30 seconds on 4 cores @4.1GHz


  • SM3.0 Shaders Only
Why?: ps20b and below is too limiting. The lack of available constant registers causes extreme branching and a lot of 'combos'. Making the code terrible to read and complicated. This disincentives Modders.
Note.pngNote:Linux is not officially supported. MacOS is also not officially supported. Users of said system will have to either patche togl to work with SM3.0 or use DxVK.
Template:ModernNote


  • Totally rewritten .h, .cpp, .fxc files


  • More Documentation for Shaders, their parameters, how they work and any possible caveats
Note.pngNote:You might have noticed Articles like $lightwarptexture, $detail, UnlitTwoTexture and $envmapmask getting major updates from ShiroDkxtro2,
where new information about Caveats and bugs were added for Team Fortress 2Alien SwarmSource 2013Counter-Strike: Global Offensive. This was a direct result of LUX development, although the focus was mainly on Source 2013Alien Swarm as their code is publicly available.
Template:ModernNote


  • Implementing features that aren't available in Source 2013
See also:  Planned Features. This includes old features such as $selfillumtexture and newer features like $phongalbedoboost(only in Counter-Strike: Global Offensive).


  • Fixing most Parameter "bugs:" and other caveats
See also:  Stock Shaders VS LUX


  • Easy way of disabling features
Icon-Important.pngImportant:A custom Pre-Processor program has been made. It automatically sets // STATIC:'s to predefined values depending on #define's in an included header file.
Template:ModernNote


  • Mapbase compatibility
Note.pngNote:Replacing SDK_ Shaders in SDK mods, SDK2013CE or Mapbase mods should be as simple as replacing the stdshaders\ Folder.
Template:ModernNote


Planned Features

This is a list of new features that are being implemented, or features that will be ported/recreated from newer branches such as Alien SwarmLeft 4 Dead 2Counter-Strike: Global Offensive Template:ModernNote

Icon-Important.pngImportant:LUX does not use any leaked code. Features like $phongalbedoboost(only in csgo) are not rocket-science. They can safely be recreated without the use of leaked code.
Template:ModernWarning


Features required for Mapbase Mapbase compatibility

Template:ModernNote
Icon-Important.pngImportant:The parameters are the same for LUX and Mapbase. This means that Mapbase compilers can be used for this to work.
Template:ModernTodo


New Features

  • In Source 2013 Multiplayer Models utilizing Model Lightmapping can use $bumpmap. Additionally all Model shaders will be able to utilize this feature. Except they have $phong.
Icon-Important.pngImportant:The Lightmap does not do bumped-lighting using the bumpmap. Only named-lights/projected textures will be able to do so.
Template:ModernNote
  • In Source 2013 Multiplayer Models can utilize Lightmap UV's.
Template:ModernWarning
Template:ModernTodo


Features ported/recreated/revived

Template:ModernNote
Template:ModernNote
See also:  PBR Shaders in the community commonly have a $emissiontexture parameter that does EXACTLY what $selfillumtexture does in LUX.

Icon-Important.pngImportant:
  • On brushes this will use the Lightmap
  • On models with $bumpmap, this will use bumped lighting.
  • On models without $bumpmap, this will use Vertex Lighting.
  • In Source 2013 Multiplayer Models utilizing Model Lightmapping, will use the Lightmap. Regardless of whether or not $bumpmap is used.


Features that are being discarded

  • $envmapsphere and related - These features have been removed since Alien Swarm and are obsolete.
Template:ModernNote


Features that won't be ported/recreated/revived

  • $basealphaenvmapmaskminmaxexp from Alien Swarm - This parameter is not yet documented on the VDC, it is also unclear what exactly it does...
  • $EnvMapLightScaleMinMax from Counter-Strike: Global Offensive


Not functional - FOR NOW


Stock Shaders VS LUX

Todo: Move This to their own pages or something like that.


LightMappedGeneric

Stock Shaders

Template:ModernBug

Template:ModernNote

Note.pngNote:$basealphaenvmapmask requires inverted masks


LUX_LightMappedGeneric

Template:ModernNote

Note.pngNote:Caveat - Has higher priority than $selfillum/$selfillummask.
Note.pngNote:Caveat - $selfillumtexture has higher priority than both.
Icon-Important.pngImportant:$basealphaenvmapmask does no longer require a flipped mask.
Template:ModernWorkaround


VertexLitGeneric

Stock Shaders

Always

$envmaplightscale(only in Counter-Strike: Global Offensive).

Without $Bumpmap

Template:ModernBug Template:ModernNote

With $Bumpmap

Template:ModernBug Template:ModernNote

With $Phong

Template:ModernBug

Template:ModernNote

LUX_VertexLitGeneric

Without $Bumpmap

Template:ModernTodo


With $Bumpmap


With $Phong

Template:ModernNote

Note.pngNote:Will use entirety of $basetexture, without being masked.

Template:ModernNote

Note.pngNote:When no $phongexponenttexture is specified, Mask will be 1.0f!
  • $envmap Can now be not-masked by using a new parameter ($phongenvmapnomask)
Icon-Important.pngImportant:By default the original masking for the $envmap will be replicated as to not have disparity. However it can now be overriden using two new parameters. $phongforcebasealphaenvmapmask and $phongforcenormalmapalphaenvmapmask
Note.pngNote:This will make materials that previously used this intentionally, look different.





Todo: Add LUX_WorldVertexTransition and other LUX_ Shaders to this list of comparison and changes.
Note.pngNote: Probably better as their own pages to document all parameters.