LUX: Difference between revisions
Jump to navigation
Jump to search
Important: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.
Features required for
Note:$basealphaenvmapmask requires inverted masks
Note:Caveat - Has higher priority than $selfillum/$selfillummask.
Important:$basealphaenvmapmask does no longer require a flipped mask.
mNo edit summary |
Roman memes (talk | contribs) m (ModernNote everywhere) |
||
Line 18: | Line 18: | ||
==Goals== | ==Goals== | ||
* '''Overhauled/Cleaned <code>materialsystem\stdshaders\</code> Folder''' | * '''Overhauled/Cleaned <code>materialsystem\stdshaders\</code> Folder''' | ||
:{{ | :{{ModernWarning|Pretty much everything except existing shader-compile functionality is pretty much "nuked".}} | ||
:{{ | :{{ModernNote|SDK_ Shaders will fall back to LUX_ Shaders, that way LUX_ can easily be used on {{mapbase|4}} mods without much work.}} | ||
:{{Notice| Implementing LUX Shaders would entail replacing the existing <code>stdshaders\</code> with the one from LUX. Effectively 'nuking' SDK_ Shaders. LUX Shaders should be able to do everything SDK_ Shaders in {{src13}} and {{mapbase}} can do.}} | |||
<br> | |||
* '''Drastically decreased compile-times for all Shaders''' | * '''Drastically decreased compile-times for all Shaders''' | ||
:{{ | :{{Why|Valves Shaders take '''forever''' to compile {{src13sp}}{{src13mp}}{{as}}. Especially using the stock Shader-Compiler. This disincentives modding the Shaders.}} | ||
:{{ | :{{Notice|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 }} | ||
<br> | |||
* '''SM3.0 Shaders Only''' | * '''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.}} | :{{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.}} | ||
:{{ | :{{Notice|Linux is not officially supported. MacOS is also not officially supported. Users of said system will have to either patche <code>togl</code> to work with SM3.0 or use DxVK. }} | ||
: | :{{ModernNote| | ||
:* SM3.0 released in 2004, and [https://cdn.cloudflare.steamstatic.com/apps/valve/2010/siggraph2010_vlachos_waterflow.pdf 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.}} | |||
<br> | |||
* '''Totally rewritten .h, .cpp, .fxc files''' | * '''Totally rewritten .h, .cpp, .fxc files''' | ||
<br> | |||
* '''More Documentation for Shaders, their parameters, how they work and any possible caveats''' | * '''More Documentation for Shaders, their parameters, how they work and any possible caveats''' | ||
:{{ | :{{Notice|You might have noticed Articles like {{ent|$lightwarptexture}}, {{ent|$detail}}, {{ent|UnlitTwoTexture}} and {{ent|$envmapmask}} getting major updates from [[User:ShiroDkxtro2|ShiroDkxtro2]], | ||
:where new information about Caveats and bugs were added for {{tf2}}{{as}}{{src13}}{{csgo}}. This was a direct result of LUX development, although the focus was mainly on {{src13}}{{as}} as their code is publicly available. }} | :where new information about Caveats and bugs were added for {{tf2}}{{as}}{{src13}}{{csgo}}. This was a direct result of LUX development, although the focus was mainly on {{src13}}{{as}} as their code is publicly available. }} | ||
:{{ | :{{ModernNote|The current lack of documentation, on how Shaders work in Source, disincentives Modders from learning how to mod Shaders or make their own. The barrier of entry is v. high as a lot of very specific knowledge is required too.}} | ||
<br> | |||
* '''Implementing features that aren't available in {{src13}}''' | * '''Implementing features that aren't available in {{src13}}''' | ||
:{{Seealso| <code>Planned Features</code>. This includes old features such as [[Glowing_Textures#.24selfillum|$selfillumtexture]] and newer features like [[$phong#Colors|$phongalbedoboost]]{{only | :{{Seealso|<code>Planned Features</code>. This includes old features such as [[Glowing_Textures#.24selfillum|$selfillumtexture]] and newer features like [[$phong#Colors|$phongalbedoboost]]{{csgo|only}}.}} | ||
<br> | |||
* '''Fixing most Parameter "bugs:" and other caveats''' | * '''Fixing most Parameter "bugs:" and other caveats''' | ||
:{{Seealso| <code>Stock Shaders VS LUX</code>}} | :{{Seealso|<code>Stock Shaders VS LUX</code>}} | ||
<br> | |||
* '''Easy way of disabling features''' | * '''Easy way of disabling features''' | ||
:{{ | :{{Important|A custom Pre-Processor program has been made. It automatically sets <code>// STATIC:</code>'s to predefined values depending on <code>#define</code>'s in an included header file.}} | ||
:{{ModernNote|Mods that don't require specific features (lightwarptexture/distancealpha/phong/envmaps/etc), can easily disable them. This will speed up Shader-compilation. Most parameters have been <code>#ifdef</code>'d in the c++ code!}} | |||
<br> | |||
* '''Mapbase compatibility''' | * '''Mapbase compatibility''' | ||
:{{ | :{{Notice|Replacing SDK_ Shaders in SDK mods, SDK2013CE or Mapbase mods should be as simple as replacing the <code>stdshaders\</code> Folder.}} | ||
:{{ | :{{ModernNote|It is assumed that no custom Shaders apart from SDK_ ones were added. If they do were added however, developers should be capable of adding them back, as that is the prerequisite for adding custom Shaders.}} | ||
<br> | |||
==Planned Features== | ==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 {{as}}{{l4d2}}{{csgo}} | This is a list of new features that are being implemented, or features that will be ported/recreated from newer branches such as {{as}}{{l4d2}}{{csgo}} | ||
{{ | {{ModernNote|Ported in this case usually means {{as}}{{mapbase}}, however in most of these cases, the code for this will be heavily adapted to simplify or overhaul it.}} | ||
{{ | {{Important|LUX does '''not''' use ''any'' leaked code. Features like [[$phong#Colors|$phongalbedoboost]]{{only|csgo}} are not rocket-science. They can safely be recreated without the use of leaked code.}} | ||
:{{ | :{{ModernWarning|For features that are more complicated, there might be visual disparity when compared to official implementations.}} | ||
<br> | |||
==== Features required for {{mapbase| | ==== Features required for {{mapbase|2}} compatibility ==== | ||
* [[$phong#Brightness|$phongdisablehalflambert]] from {{as}}+ | * [[$phong#Brightness|$phongdisablehalflambert]] from {{as}}+ | ||
* Radial Fog for all "Geometry" Shaders | * Radial Fog for all "Geometry" Shaders | ||
* Spline-Ropes | * Spline-Ropes | ||
* Parallax Corrected Cubemaps ( PCC ) | * Parallax Corrected Cubemaps ( PCC ) | ||
:{{ | :{{ModernNote|Just like {{mapbase|2}}, this requires custom compilers to work.}} | ||
:{{important|The parameters are the same for LUX and {{mapbase}}. This means that Mapbase compilers can be used for this to work.}} | :{{important|The parameters are the same for LUX and {{mapbase}}. This means that Mapbase compilers can be used for this to work.}} | ||
* {{ent|$envmapmask}} + {{ent|$bumpmap}} on {{ent|VertexLitGeneric}} | * {{ent|$envmapmask}} + {{ent|$bumpmap}} on {{ent|VertexLitGeneric}} | ||
Line 64: | Line 73: | ||
* Brush {{ent|$phong}} | * Brush {{ent|$phong}} | ||
* Treesway | * Treesway | ||
:{{ | :{{ModernTodo|Is the {{mapbase}} implementation ported from {{as}}?}} | ||
<br> | |||
==== New Features ==== | ==== New Features ==== | ||
* In {{src13mp}} Models utilizing Model Lightmapping can use {{ent|$bumpmap}}. Additionally all Model shaders will be able to utilize this feature. Except they have {{ent|$phong}}. | * In {{src13mp}} Models utilizing Model Lightmapping can use {{ent|$bumpmap}}. Additionally all Model shaders will be able to utilize this feature. Except they have {{ent|$phong}}. | ||
:{{important|The Lightmap does not do bumped-lighting using the bumpmap. Only named-lights/projected textures will be able to do so.}} | :{{important|The Lightmap does not do bumped-lighting using the bumpmap. Only named-lights/projected textures will be able to do so.}} | ||
:{{ | :{{ModernNote| Lightmapped models will not be able to receive {{ent|$phong}}. This is not planned at the moment but should be possible for named-lights/projected textures!}} | ||
* In {{src13mp}} Models can utilize Lightmap UV's. | * In {{src13mp}} Models can utilize Lightmap UV's. | ||
:{{ | :{{ModernWarning|The way this is currently implemented requires a custom written tool, two smd's ( one with lightmap uv ) and also has a lot of precision loss for the Lightmap UV's. Additionally this requires a custom compiler! }} | ||
::{{ | ::{{ModernTodo|Investigate {{src07}} code, supposedly the Studiomdl code is there. Maybe it can be packed via Blendweights or alternatively the precision loss might be decreased.}} | ||
<br> | |||
==== Features ported/recreated/revived ==== | ==== Features ported/recreated/revived ==== | ||
* [[$phong#Brightness|$phongdisablehalflambert]] From {{as}}+ - Also needed for {{mapbase}} | * [[$phong#Brightness|$phongdisablehalflambert]] From {{as}}+ - Also needed for {{mapbase}} | ||
Line 79: | Line 88: | ||
* [[$phong#Colors|$phongalbedoboost]] From {{csgo}} - Its just <code>BaseTexture * $PhongAlbedoBoost</code>... No leaked code! | * [[$phong#Colors|$phongalbedoboost]] From {{csgo}} - Its just <code>BaseTexture * $PhongAlbedoBoost</code>... No leaked code! | ||
* [[$phong#Masking|$basemapluminancephongmask]] From {{as}}+ | * [[$phong#Masking|$basemapluminancephongmask]] From {{as}}+ | ||
:{{ | :{{ModernNote| | ||
Previously SDK_ Shaders would use the NTSC Analog Television standard of <code>float3(0.2990f, 0.5870f, 0.1140f)</code> }} | :* LUX allows the use of Rec. 709 HDTV Luminance Weights. <code>float3(0.2126f, 0.7152f, 0.0722f)</code>. | ||
:* Previously SDK_ Shaders would use the NTSC Analog Television standard of <code>float3(0.2990f, 0.5870f, 0.1140f)</code>}} | |||
* [[Glowing_Textures#.24selfillum|$selfillumtexture]] Deprecated since {{src07}} - This used to be obsolete | * [[Glowing_Textures#.24selfillum|$selfillumtexture]] Deprecated since {{src07}} - This used to be obsolete | ||
:{{ | :{{ModernNote| Yes, there is a use for this! [[$detail#Parameters and Effects|$detailblendmode]] 5 is commonly used for glowing textures. This parameter allows for not wasting your $detail. Additionally no $emissiveblend is required.}} | ||
:{{seealso|PBR Shaders in the community commonly have a $emissiontexture parameter that does EXACTLY what [[Glowing_Textures#.24selfillum|$selfillumtexture]] does in LUX.}} | :{{seealso|PBR Shaders in the community commonly have a $emissiontexture parameter that does EXACTLY what [[Glowing_Textures#.24selfillum|$selfillumtexture]] does in LUX.}} | ||
* Water Shader with {{ent|$flowmap}} Support - From {{as}} | * Water Shader with {{ent|$flowmap}} Support - From {{as}} | ||
* {{ent|$envmaplightscale}} From {{as}} for brushes{{as}}+ AND models {{only|{{csgo}}}}+ | * {{ent|$envmaplightscale}} From {{as}} for brushes{{as}}+ AND models {{only|{{csgo}}}}+ | ||
:{{important | :{{important| | ||
:* On brushes this will use the Lightmap | |||
:* On models '''with''' {{ent|$bumpmap}}, this will use bumped lighting. | |||
:* On models without {{ent|$bumpmap}}, this will use Vertex Lighting. | |||
:* In {{src13mp}} Models utilizing Model Lightmapping, will use the Lightmap. Regardless of whether or not {{ent|$bumpmap}} is used.}} | |||
<br> | |||
==== Features that are being discarded ==== | ==== Features that are being discarded ==== | ||
* {{ent|$envmapsphere}} and related - These features have been removed since {{as}} and are obsolete. | * {{ent|$envmapsphere}} and related - These features have been removed since {{as}} and are obsolete. | ||
:{{ | :{{ModernNote|This is very easy to re-implement. The 7th face of a Cubemap is still being built in {{src13}} and therefore this feature is still operational given that the code has been implemented!}} | ||
* [[$bumpmap#Additional_Parameters|$bumpmask]] and related | * [[$bumpmap#Additional_Parameters|$bumpmask]] and related | ||
<br> | |||
==== Features that '''won't''' be ported/recreated/revived ==== | ==== Features that '''won't''' be ported/recreated/revived ==== | ||
* $basealphaenvmapmaskminmaxexp from {{as}} - This parameter is not yet documented on the VDC, it is also unclear what exactly it does... | * $basealphaenvmapmaskminmaxexp from {{as}} - This parameter is not yet documented on the VDC, it is also unclear what exactly it does... | ||
* $EnvMapLightScaleMinMax from {{csgo}} | * $EnvMapLightScaleMinMax from {{csgo}} | ||
<br> | |||
==== Not functional - FOR NOW ==== | ==== Not functional - FOR NOW ==== | ||
* {{ent|$emissiveblend}} - Non-Existant. Planned for later. | * {{ent|$emissiveblend}} - Non-Existant. Planned for later. | ||
Line 107: | Line 117: | ||
* [[$detail#Parameters and Effects|$detailblendmode]] <code>10 & 11</code>. - Non-Functional. Planned for later. | * [[$detail#Parameters and Effects|$detailblendmode]] <code>10 & 11</code>. - Non-Functional. Planned for later. | ||
<br> | <br> | ||
=Stock Shaders VS LUX= | =Stock Shaders VS LUX= | ||
{{todo|Move This to their own pages or something like that.}} | {{todo|Move This to their own pages or something like that.}} | ||
<br> | |||
== LightMappedGeneric == | |||
=== Stock Shaders === | |||
{{ModernBug| | |||
[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}} 2-9 Don't work.<br> | |||
[[$detail#Parameters and Effects|$detailblendmode]]{{as}} 6 Doesn't work.<br> | |||
[[$detail#Parameters and Effects|$detailblendmode]]{{csgo}} 1-6, 8 Don't work. 9 Does not work with {{ent|$bumpmap}}, {{ent|$envmap}} or {{ent|$selfillum}}<br> | |||
{{ent|$bumpmap}} + {{ent|$envmapmask}} Doesn't work, except in {{csgo|4}}<br> | |||
{{ent|$lightwarptexture}} + {{ent|$detail}}{{tf2}}{{as}} Doesn't work.<br> | |||
{{ent|$basealphaenvmapmask}} + {{ent|bumpmap}} Doesn't work}} | |||
{{ModernNote| | |||
[[Glowing_Textures#.24selfillum|$selfillummask]] Missing<br> | |||
{{ent|$selfillum_envmapmask_alpha}} Missing<br> | |||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] Missing<br> | |||
{{ent|$blendtintbybasealpha}} Missing<br> | |||
[[$detail#Parameters and Effects|$detailtexturetransform]] Missing<br> | |||
{{ent|$lightwarptexture}}{{csgo}} Missing<br> | |||
{{ent|$envmapfresnelminmaxexp}}{{only|{{l4d}}+}}<br> | |||
{{ent|$envmaplightscale}}{{only|{{as}}+}}}} | |||
{{Notice|{{ent|$basealphaenvmapmask}} requires inverted masks}} | |||
{{ | |||
<br> | <br> | ||
{{ | === LUX_LightMappedGeneric === | ||
{{ModernNote| | |||
[[$detail#Parameters and Effects|$detailblendmode]] 1-9 works.<br> | |||
<br> | [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned.<br> | ||
{{ent|$bumpmap}} + {{ent|$envmapmask}} works, used to be {{only|{{csgo}}.}}<br> | |||
{{ent|$lightwarptexture}} + {{ent|$detail}} works ( does not work in {{as}}{{tf2}} ).<br> | |||
{{ent|$basealphaenvmapmask}} + {{ent|$bumpmap}} works.<br> | |||
[[Glowing_Textures#.24selfillum|$selfillummask]] Exists now.<br> | |||
{{ent|$blendtintbybasealpha}} Exists now.<br> | |||
{{ent|$selfillum_envmapmask_alpha}} Exists now.<br> | |||
[[$detail#Parameters and Effects|$detailtexturetransform]] Exists now.}} | |||
{{Notice|Caveat - Has higher priority than [[Glowing_Textures#.24selfillum|$selfillum]]/[[Glowing_Textures#.24selfillum|$selfillummask]].}} | |||
:{{Notice|Caveat - [[Glowing_Textures#.24selfillum|$selfillumtexture]] has higher priority than both.}} | |||
{{important|{{ent|$basealphaenvmapmask}} does no longer require a flipped mask.}} | |||
:{{ModernWorkaround|Materials that previously used have to be adjusted. Use {{ent|$envmapmask}} or {{ent|$normalmapalphaenvmapmask}} instead!}} | |||
<br> | |||
== VertexLitGeneric == | == VertexLitGeneric == | ||
=== Stock | === Stock Shaders === | ||
==== Always ==== | ==== Always ==== | ||
{{ent|$envmaplightscale}}{{only|{{csgo}}}}. | {{ent|$envmaplightscale}}{{only|{{csgo}}}}. | ||
<br> | |||
==== Without $Bumpmap ==== | ==== Without $Bumpmap ==== | ||
{{ | {{ModernBug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 10-11 Don't work.<br> | ||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] missing.<br> | |||
{{ent|$lightwarptexture}} missing.}} | |||
{{ModernNote|$lightwarptexture fores bumpmapping by binding a default one, unless one is manually specified.}} | |||
<br> | |||
==== '''With''' $Bumpmap ==== | ==== '''With''' $Bumpmap ==== | ||
{{ | {{ModernBug| | ||
[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 5-11 Don't work.<br> | |||
{{ | [[$detail#Parameters and Effects|$detailblendmode]]{{csgo}} 5-6 & 8-11 Don't work.}} | ||
{{ModernNote| | |||
{{ent|$envmapmask}} missing. Except {{mapbase}}.<br> | |||
[[Glowing_Textures#.24selfillum|$selfillummask]] missing. {{ModernConfirm|Only in {{mapbase}}?}} | |||
{{ent|$selfillum_envmapmask_alpha}}{{mapbase}} missing.<br> | |||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] disables {{ent|$normalmapalphaenvmapmask}}. {{ModernTodo|Also on other branches than {{as}}?}}}} | |||
<br> | |||
==== With $Phong ==== | ==== With $Phong ==== | ||
{{ | {{ModernBug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 8-11 Don't work. | ||
[[$phong#Masking|$invertphongmask]]{{as}}{{src13}} In the shadercode, only flips the mask used for {{ent|$envmap}}. {{ModernConfirm|Also on newer branches?}} | |||
[[$phong#Colors|$phongalbedotint]] cannot be used without [[$phong#Masking|$phongexponenttexture]].<br> | |||
{{ent|$phongwarptexture}}{{l4d2}} does not work.<br> | |||
[[$phong#Colors|$phongalbedoboost]]{{only|{{csgo}}}} + {{ent|$detail}} does not work.<br> | |||
[[$phong#Colors|$phongtint]] disables [[$phong#Colors|$phongalbedotint]].<br> | |||
{{ent|$envmap}} always masked by something.<br> | |||
{{ | {{Only in {{l4d}}+ {{ent|$envmap}} masked by {{ent|$basetexture}} luminance when {{ent|$normalmapalphaenvmapmask}} and [[$phong#Masking|$basemapluminancephongmask]] is used.<br> | ||
{{ent|$envmap}} masked by {{ent|$basetexture}} alpha when {{ent|$normalmapalphaenvmapmask}} and [[$phong#Masking|$basemapalphaphongmask]] is used.<br> | |||
[[$phong#Masking|$basemapalphaphongmask]] makes {{ent|$phong}} ignore the {{ent|$bumpmap}}.<br> | |||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] + {{ent|$normalmapalphaenvmapmask}} will cause the {{ent|$envmap}} to be multiplied by <code>0.0f</code> regardless of whether [[$phong#Masking|$invertphongmask]] is used.<br> | |||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] will cause {{ent|$envmap}} to be masked using the {{ent|$basetexture}} alpha channel.}}}} | |||
{{ModernNote|[[$phong#Brightness|$phongdisablehalflambert]] only in {{as}}+<br> | |||
[[$phong#Masking|$phongexponentfactor]] only in {{tf2}}{{src13mp}}<br> | |||
[[$phong#Masking|$basemapluminancephongmask]] only in {{l4d}}+<br> | |||
[[$phong#Colors|$phongalbedoboost]] only in {{csgo}}+}} | |||
<br> | |||
=== LUX_VertexLitGeneric === | === LUX_VertexLitGeneric === | ||
==== Without $Bumpmap ==== | ==== Without $Bumpmap ==== | ||
Line 188: | Line 206: | ||
* [[Glowing_Textures#.24selfillum|$selfillumfresnel]] Exists now.<br> | * [[Glowing_Textures#.24selfillum|$selfillumfresnel]] Exists now.<br> | ||
* {{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.}} | ||
<br> | |||
==== '''With''' $Bumpmap ==== | ==== '''With''' $Bumpmap ==== | ||
* [[$detail#Parameters and Effects|$detailblendmode]] 5-9 work.<br> | * [[$detail#Parameters and Effects|$detailblendmode]] 5-9 work.<br> | ||
Line 197: | Line 215: | ||
* {{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> | ||
<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> | ||
* [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | * [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | ||
{{ModernNote|[[$phong#Masking|$invertphongmask]] Now only flips the mask used for phong. It will no longer touch the envmapmask ''at all''.<br> | |||
[[$phong#Colors|$phongalbedotint]] can now be used without [[$phong#Masking|$phongexponenttexture]].}} | |||
:{{Notice|Will use entirety of {{ent|$basetexture}}, without being masked.}} | |||
* [[$phong#Colors|$phongwarptexture]] works. ( does not work in {{l4d2}} ).<br> | * [[$phong#Colors|$phongwarptexture]] works. ( does not work in {{l4d2}} ).<br> | ||
* [[$phong#Colors|$phongalbedoboost]] Exists now. Used to be {{only|{{csgo}}.}} | * [[$phong#Colors|$phongalbedoboost]] Exists now. Used to be {{only|{{csgo}}.}} | ||
* [[$phong#Colors|$phongalbedoboost]] + {{ent|$detail}} Works. Does not work in {{csgo|4}}.<br> | * [[$phong#Colors|$phongalbedoboost]] + {{ent|$detail}} Works. Does not work in {{csgo|4}}.<br> | ||
{{ModernNote|[[$phong#Colors|$phongtint]] does no longer disable [[$phong#Colors|$phongalbedotint]]. It will do <code>($baseTexture * Mask) * $PhongTint</code>}} | |||
:{{Notice|When no [[$phong#Masking|$phongexponenttexture]] is specified, Mask will be 1.0f!}} | |||
* {{ent|$envmap}} Can now be not-masked by using a new parameter (<code>$phongenvmapnomask</code>) | * {{ent|$envmap}} Can now be not-masked by using a new parameter (<code>$phongenvmapnomask</code>) | ||
: {{important|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. <code>$phongforcebasealphaenvmapmask</code> and <code>$phongforcenormalmapalphaenvmapmask</code>}} | |||
However it can now be overriden using two new parameters. <code>$phongforcebasealphaenvmapmask</code> and <code>$phongforcenormalmapalphaenvmapmask</code>}} | |||
* [[$phong#Masking|$basemapalphaphongmask]] '''no longer''' makes {{ent|$phong}} ignore the {{ent|$bumpmap}}. | * [[$phong#Masking|$basemapalphaphongmask]] '''no longer''' makes {{ent|$phong}} ignore the {{ent|$bumpmap}}. | ||
:{{Notice|This will make materials that previously used this intentionally, look different.}} | |||
* [[Glowing_Textures#.24selfillum|$selfillumfresnel]] + {{ent|$normalmapalphaenvmapmask}} will no longer multiply the {{ent|$envmap}} by <code>0.0f</code> | * [[Glowing_Textures#.24selfillum|$selfillumfresnel]] + {{ent|$normalmapalphaenvmapmask}} will no longer multiply the {{ent|$envmap}} by <code>0.0f</code> | ||
* [[$phong#Brightness|$phongdisablehalflambert]] Exists now. ( Used to be {{only|{{as}}+}} | * [[$phong#Brightness|$phongdisablehalflambert]] Exists now. ( Used to be {{only|{{as}}+}} |
Revision as of 10:15, 19 February 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 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: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 )
- $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
Todo: Move This to their own pages or something like that.
LightMappedGeneric
Stock Shaders

LUX_LightMappedGeneric

Note:Caveat - $selfillumtexture has higher priority than both.

VertexLitGeneric
Stock Shaders
Always
$envmaplightscale(only in ).
Without $Bumpmap
Template:ModernBug
Template:ModernNote
With $Bumpmap
Template:ModernBug
Template:ModernNote
With $Phong
LUX_VertexLitGeneric
Without $Bumpmap
- $detailblendmode 10-11 planned. If possible.
- $selfillumfresnel Exists now.
- $lightwarptexture Exists now.
With $Bumpmap
- $detailblendmode 5-9 work.
- $detailblendmode 10-11 planned. If possible.
- $envmapmask Exists now.
- $selfillummask Exists now.
- $selfillum_envmapmask_alpha Exists now.
- $selfillumfresnel + $normalmapalphaenvmapmask Works now.
With $Phong
- $detailblendmode 8-9 work now.
- $detailblendmode 10-11 planned. If possible.
Note:Will use entirety of $basetexture, without being masked.
- $phongwarptexture works. ( does not work in
).
- $phongalbedoboost Exists now. Used to be (only in
.)
- $phongalbedoboost + $detail Works. Does not work in
Counter-Strike: Global Offensive.
Note:When no $phongexponenttexture is specified, Mask will be 1.0f!
- $envmap Can now be not-masked by using a new parameter (
$phongenvmapnomask
)
Important: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
- $basemapalphaphongmask no longer makes $phong ignore the $bumpmap.
Note:This will make materials that previously used this intentionally, look different.
- $selfillumfresnel + $normalmapalphaenvmapmask will no longer multiply the $envmap by
0.0f
- $phongdisablehalflambert Exists now. ( Used to be (only in
+)
- $phongexponentfactor Exists now for
. ( Used to be (only in
)
- $basemapluminancephongmask Exists now. ( Used to be (only in
+)
- $phongalbedoboost Exists now. ( Used to be (only in
+)
Todo: Add LUX_WorldVertexTransition and other LUX_ Shaders to this list of comparison and changes.
Note: Probably better as their own pages to document all parameters.