LUX: Difference between revisions
Line 169: | Line 169: | ||
== VertexLitGeneric == | == VertexLitGeneric == | ||
{| cellspacing="0" | |||
|- valign="top" | |||
| style="width:50%; padding-right:2em" | | |||
=== Stock Shaders === | === Stock Shaders === | ||
==== Always ==== | ==== Always ==== | ||
{{ent|$envmaplightscale}}{{only|{{csgo}}}}. | {{ent|$envmaplightscale}}{{only|{{csgo}}}}. | ||
==== Without $Bumpmap ==== | ==== Without $Bumpmap ==== | ||
{{ModernBug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 10-11 Don't work.<br> | {{ModernBug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 10-11 Don't work.<br> | ||
Line 178: | Line 182: | ||
{{ent|$lightwarptexture}} missing.}} | {{ent|$lightwarptexture}} missing.}} | ||
{{ModernNote|$lightwarptexture fores bumpmapping by binding a default one, unless one is manually specified.}} | {{ModernNote|$lightwarptexture fores bumpmapping by binding a default one, unless one is manually specified.}} | ||
==== '''With''' $Bumpmap ==== | ==== '''With''' $Bumpmap ==== | ||
{{ModernBug| | {{ModernBug| | ||
Line 188: | Line 193: | ||
{{ent|$selfillum_envmapmask_alpha}}{{mapbase}} missing.<br> | {{ent|$selfillum_envmapmask_alpha}}{{mapbase}} missing.<br> | ||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] disables {{ent|$normalmapalphaenvmapmask}}. {{ModernTodo|Also on other branches than {{as}}?}}}} | [[Glowing_Textures#.24selfillum|$selfillumfresnel]] disables {{ent|$normalmapalphaenvmapmask}}. {{ModernTodo|Also on other branches than {{as}}?}}}} | ||
==== With $Phong ==== | ==== With $Phong ==== | ||
{{ModernBug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 8-11 Don't work. | {{ModernBug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 8-11 Don't work. | ||
Line 207: | Line 213: | ||
[[$phong#Masking|$basemapluminancephongmask]] only in {{l4d}}+<br> | [[$phong#Masking|$basemapluminancephongmask]] only in {{l4d}}+<br> | ||
[[$phong#Colors|$phongalbedoboost]] only in {{csgo}}+}} | [[$phong#Colors|$phongalbedoboost]] only in {{csgo}}+}} | ||
| width="50%" | | |||
=== {{LUX}}LUX_VertexLitGeneric === | === {{LUX}}LUX_VertexLitGeneric === | ||
==== Without $Bumpmap ==== | ==== Without $Bumpmap ==== | ||
Line 214: | Line 222: | ||
* {{ent|$lightwarptexture}} Exists now.<br> | * {{ent|$lightwarptexture}} Exists now.<br> | ||
::{{ModernTodo|Make a parameter that allows its usage. Right now default behavior is replicated and a default bumpmap is bound.}} | ::{{ModernTodo|Make a parameter that allows its usage. Right now default behavior is replicated and a default bumpmap is bound.}} | ||
==== '''With''' $Bumpmap ==== | ==== '''With''' $Bumpmap ==== | ||
* [[$detail#Parameters and Effects|$detailblendmode]] 5-9 work.<br> | * [[$detail#Parameters and Effects|$detailblendmode]] 5-9 work.<br> | ||
Line 222: | Line 231: | ||
* {{ent|$selfillum_envmapmask_alpha}} Exists now.<br> | * {{ent|$selfillum_envmapmask_alpha}} Exists now.<br> | ||
* [[Glowing_Textures#.24selfillum|$selfillumfresnel]] + {{ent|$normalmapalphaenvmapmask}} Works now.<br> | * [[Glowing_Textures#.24selfillum|$selfillumfresnel]] + {{ent|$normalmapalphaenvmapmask}} Works now.<br> | ||
==== With $Phong ==== | ==== With $Phong ==== | ||
* [[$detail#Parameters and Effects|$detailblendmode]] 8-9 work now.<br> | * [[$detail#Parameters and Effects|$detailblendmode]] 8-9 work now.<br> | ||
Line 248: | Line 258: | ||
* [[$phong#Masking|$basemapluminancephongmask]] Exists now. ( Used to be {{only|{{l4d}}+}} | * [[$phong#Masking|$basemapluminancephongmask]] Exists now. ( Used to be {{only|{{l4d}}+}} | ||
* [[$phong#Colors|$phongalbedoboost]] Exists now. ( Used to be {{only|{{csgo}}+}} | * [[$phong#Colors|$phongalbedoboost]] Exists now. ( Used to be {{only|{{csgo}}+}} | ||
|} | |||
==History== | ==History== |
Revision as of 10:54, 14 April 2023
LUX | |
---|---|
![]() | |
Wiki | |
Type | Modification |
Developers | ShiroDkxtro2 |
Engine | ![]() |
Platforms | (only in PC) |
Based on | ![]() |
LUX is a mod specifically made and developed for use in
Source 2013 Singleplayer and
Source 2013 Multiplayer.
The Project is to entirely rewrite all existing "SDK_" Shaders, that come with the SDK and all those available in Mapbase.
Goals
- Overhauled/Cleaned
materialsystem\stdshaders\
Folder
- Drastically decreased compile-times for all Shaders
Note: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:Linux is not officially supported. MacOS is also not officially supported. Users of said system will have to either patch
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: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
. This was a direct result of
LUX development, although the focus was mainly on
as their code is publicly available.
- Template:ModernNote
- See also: Planned Features. This includes old features such as $selfillumtexture and newer features like $phongalbedoboost(only in
).
- Fixing most Parameter "bugs:" and other caveats
- See also: Stock Shaders VS LUX
- Easy way of disabling features
Important: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: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
Template:ModernNote


Features required for
Mapbase compatibility
- $phongdisablehalflambert from
+
- Radial Fog for all "Geometry" Shaders
- Spline-Ropes
- Parallax Corrected Cubemaps ( PCC )
- Template:ModernNote
Important:The parameters are the same for
LUX and
. This means that Mapbase compilers can be used for this to work.
- $envmapmask + $bumpmap on VertexLitGeneric
- Replacement for the "Postprocessing" Controller Shader
- Replacement for the "Engine_post" Shader from
- Hammer $blendmodulatetexture previewing fix.
- Brush $phong
- Treesway
New Features
- In
Models utilizing Model Lightmapping can use $bumpmap. Additionally all Model shaders will be able to utilize this feature. Except they have $phong.
Important:The Lightmap does not do bumped-lighting using the bumpmap. Only named-lights/projected textures will be able to do so.
- Template:ModernNote
Features ported/recreated/revived
- $phongdisablehalflambert From
+ - Also needed for
- $phongexponentfactor From
, with
LUX also on
- $phongalbedoboost From
- Its just
BaseTexture * $PhongAlbedoBoost
... No leaked code! - $basemapluminancephongmask From
+
- $selfillumtexture Deprecated since
- This used to be obsolete
- Template:ModernNote
- See also: PBR Shaders in the community commonly have a $emissiontexture parameter that does EXACTLY what $selfillumtexture does in
LUX.
- Water Shader with $flowmap Support - From
- $envmaplightscale From
for brushes
+ AND models (only in
)+
Features that are being discarded
- $envmapsphere and related - These features have been removed since
and are obsolete.
- $bumpmask and related
Features that won't be ported/recreated/revived
- $basealphaenvmapmaskminmaxexp from
- This parameter is not yet documented on the VDC, it is also unclear what exactly it does...
- $EnvMapLightScaleMinMax from
Not functional - FOR NOW
- $emissiveblend - Non-Existant. Planned for later.
- $distancealpha - Non-Functional. Planned for later.
- $ssbump - Non-Functional. Planned for later.
- $detailblendmode
10 & 11
. - Non-Functional. Planned for later.
Stock Shaders VS LUX
LightMappedGeneric
Stock Shaders![]() |
|
VertexLitGeneric
Stock ShadersAlways$envmaplightscale(only in
Without $BumpmapTemplate:ModernBug Template:ModernNote
With $BumpmapTemplate:ModernBug Template:ModernNote
With $Phong |
|
History
LUX started developement on the 20.01.2023 DMY, but it was planned and thought ~14.01.2023 when the lead-developer ShiroDkxtro2 was in a hospital stay.
Even before 2023, the idea of rewritting Valve's Shaders was in mind. Various people asked ShiroDkxtro2 if certain modifications could be implemented for default shaders, such as CSM.
These requests would usually result in a simple "no.", modifying the default shaders was not considered feasible for various reasons, most of which are indirectly mentioned in LUX's Goals.
The Inception was supposed to be a means to make the existing Shaders more modable, with new features in mind and laid out so that implementing new things would be easier.
Credits
However, it is only used to compile the Shaders. Include files ( .inc ) are intended to be made using Perl.
LUX copies various code from thexa4's PBR header
- Tottery ( Also known as TotteryNine )
TotteryNine was crucial to ShiroDkxtro2 for learning the basics and more complicated aspects of making and compiling Shaders.
- Sitkinator
Aiding with the initial logo and adding a screen-reflection effect to it.
- Mr.Kleiner
For writing various tools. Including a VTF Flagging tool for Cubemaps inside a .bsp file, a tool for packing lightmap uv's into .smd files
- roman_memes
Various logical checks and ideas. Also helped with prototyping new features and finding siggraph or other papers regarding modern and oldschool graphical implementations.
- Alivebyte!
For doing modifications to the ShaderCompiler, which so far have not been implemented into the repo.
For enlightening us about the Constant Register Hack.
Which allows for the use of more than 32 float constant registers on sm3.0
This Project would be near impossible without it.
- ChatGPT
Help with programming and undocumented graphical features of the Source Engine.
It knows things and can make new things to a degree. Various code used in LUX has been partically written by the AI.
Since one of the goals of this project is to be compatible with it, various code from it has been adapted.
This means that all Shader-related things should also be inhereted with the credits of LUX. You can find Mapbase's credits HERE.
One example would be the NvidiaPCF5x5Gaussian Shadow Filter Template:ModernNote ShiroDkxtro2 would also like to thank Joshua Ashton personally for his various open-source work related to the source engine.
See also
- Development can be followed here, Bug-Reports & suggestions made.
- It is also intended as a general place for discussing
Source 2013 related Shader-Modding.