LUX: Difference between revisions
ShiroDkxtro2 (talk | contribs) m (Added Credits, History, See Also and implemented LUX Template) |
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified) |
||
(39 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar}} | ||
{{Infotable | |||
{{ | | state = 5 | ||
|state=5 | | ownwiki = https://github.com/ShiroDkxtro2/ACROHS-LUX_-Shaders-Project/wiki | ||
|ownwiki=https://github.com/ShiroDkxtro2/ACROHS-LUX_-Shaders-Project/wiki | | type = m0 | ||
|type=m0 | | dev = [[User:ShiroDkxtro2|ShiroDkxtro2]] | ||
|dev=[[User:ShiroDkxtro2|ShiroDkxtro2]] | | engine = 2 | ||
|engine=2 | | base = {{src13|4}} | ||
|base={{src13|4}} | | platform = {{PC|4}} | ||
|platform={{ | | github = ShiroDkxtro2/ACROHS-LUX_-Shaders-Project | ||
|github=ShiroDkxtro2/ACROHS-LUX_-Shaders-Project | | discord = https://discord.gg/cGv8GGSkpc | ||
|discord=https://discord.gg/cGv8GGSkpc | |||
}} | }} | ||
{{LUX|4}} is a [[Modification|mod]] specifically made and developed for use in {{src13sp|4.1}} and {{src13mp|4.1}}.<br> | |||
The Project is to entirely rewrite all existing "'''SDK_'''" Shaders, that come with the SDK and all those available in {{mapbase|4.1}}. | |||
{{LUX|4}} | == Goals == | ||
;Overhaul/Clean {{file|materialsystem\stdshaders\}} Folder | |||
: Implementing {{LUX|4.1}} Shaders would entail replacing the existing {{file|stdshaders\}} folder. {{LUX|4.1}} Shaders should be able to do everything SDK_ Shaders in {{src13}} and {{mapbase}} can do. | |||
:SDK_ Shaders will fall back to LUX_ Shaders, that way {{LUX|4.1}} can easily be used on {{mapbase|4.1}} mods without much work. | |||
:Many .h, .cpp, .fxc files have been rewritten | |||
<br> | |||
: | ;Drastically decrease compile times for all Shaders | ||
: | : With {{LUX|4.1}}, compiling the entirety of LUX_LightMappedGeneric takes around 30 seconds on 4 cores @4.1GHz | ||
<br> | <br> | ||
;SM3.0 Shaders Only | |||
: {{linux|4.1}} and {{Mac|4.1}} are not officially supported. Users of said systems will have to either patch <code>togl</code> to work with SM3.0 or use DxVK. | |||
:{{ | : {{Note| | ||
:{{ | |||
:* 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''' | :* 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.}} | :* This means that older hardware not capable of SM3.0 will not be able to use the new Shaders.}} | ||
<br> | <br> | ||
;More Documentation for Shaders, their parameters, how they work and any possible caveats | |||
: You might have noticed Articles like {{Ent|$lightwarptexture}}, {{Ent|$detail}}, {{Ent|UnlitTwoTexture}} and {{Ent|$envmapmask}} getting major updates with new information about caveats and bugs. | |||
: This was a direct result of {{LUX|4.1}} development, although the focus was mainly on {{src13}} and {{as}} as their code is publicly available. | |||
<br> | <br> | ||
;Implementing features that aren't available in {{src13|4.1}} | |||
: {{Seealso|[[LUX#Planned Features|Planned Features]]. This includes old features such as [[Glowing_Textures#.24selfillum|$selfillumtexture]] and newer features like [[$phong#Colors|$phongalbedoboost]]{{csgo|only}}.}} | |||
<br> | <br> | ||
;Fixing most Parameter bugs and other caveats | |||
: {{Seealso|[[LUX#Stock Shaders VS LUX|Stock Shaders VS LUX]]}} | |||
:{{Seealso|[[LUX#Stock Shaders VS LUX|Stock Shaders VS LUX]]}} | |||
<br> | <br> | ||
;Easy way of disabling features | |||
: | : A custom Pre-Processor program has been made, allowing Mods that don't require specific features to easily disable them and further increase Shader compilation speed. | ||
<br> | <br> | ||
;{{mapbase|4.1}} compatibility | |||
: | : Replacing SDK_ Shaders in SDK mods, SDK2013CE or Mapbase mods should be as simple as replacing the {{file|stdshaders\}} Folder, assuming that no custom [[shaders]] were added. If they were added, developers may need to add them back or recreate them. | ||
<br> | <br> | ||
This is a list of new features that are being implemented | = Planned Features = | ||
{{ | This is a list of new features that are being implemented / will be implemented from newer branches such as: | ||
{{ | *{{asbranch|4.1}} | ||
:{{ | *{{l4dbranch|4.1}} | ||
*{{csgobranch|4.1}} | |||
=== | The code may be modified for simplification or if it needs a overhaul | ||
* [[$phong#Brightness|$phongdisablehalflambert]] from {{ | |||
{{ModernImportant|{{LUX|2}} does '''not''' use '''any''' leaked code. Features like [[$phong#Colors|$phongalbedoboost]]{{only|{{csgo}}}} are not rocket science and easily be recreated. | |||
:{{warning|For more complicated features, there might be visual disparity when compared to official implementations.}}}} | |||
=== {{mapbase|4.1}} compatibility === | |||
{{ModernImportant|The parameters will be the same as {{mapbase|4.1}}, meaning that Mapbase's compilers can be used}} | |||
* [[$phong#Brightness|$phongdisablehalflambert]], ported from the {{asbranch|4.1}} | |||
* Radial Fog for all "Geometry" Shaders | * Radial Fog for all "Geometry" Shaders | ||
* Spline-Ropes | * Spline-Ropes | ||
* Parallax Corrected Cubemaps | * [[Parallax Corrected Cubemaps]] | ||
**Just like with {{mapbase|4.1}}, this will require a custom compiler to work. | |||
* {{Ent|$envmapmask}} + {{Ent|$bumpmap}} on {{Ent|VertexLitGeneric}} | |||
* {{ | |||
* Replacement for the "Postprocessing" Controller Shader | * Replacement for the "Postprocessing" Controller Shader | ||
* Replacement for the "Engine_post" Shader from {{as}} | * Replacement for the "Engine_post" Shader from {{as}} | ||
* Hammer {{ | * Hammer {{Ent|$blendmodulatetexture}} previewing fix. | ||
* Brush {{ | * Brush {{Ent|$phong}} | ||
* Treesway | * Treesway | ||
:{{ | : {{confirm|Is the {{mapbase|4.1}} implementation ported from {{as|4.1}}?}} | ||
* [[$bumpmap#Additional_Parameters|$bumpmask]] and related | |||
<br> | <br> | ||
* In {{src13mp}} | === New features === | ||
* In {{src13mp|4.1}}, models utilizing Model Lightmapping can use {{Ent|$bumpmap}}. Additionally, all Model shaders will be able to utilize this feature, unless they have {{Ent|$phong}}. | |||
**The Lightmap does not do bumped-lighting using the bumpmap. Only named lights/projected textures will be able to do so. | |||
**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. | ||
**The way this is currently implemented requires a custom-written tool, two SMDs (one with a lightmap uv), and also has a lot of precision loss for the Lightmap UVs. Additionally, this requires a custom compiler! {{todo|Investigate {{src07|4.1}} code, supposedly the Studiomdl code is there. Maybe it can be packed via Blendweights or the precision loss might be decreased.}} | |||
=== Features ported/recreated === | |||
* [[$phong#Brightness|$phongdisablehalflambert]] {{as|since}} - Also needed for {{mapbase|4.1}} | |||
* [[$phong#Brightness|$phongdisablehalflambert]] | * [[$phong#Masking|$phongexponentfactor]] From {{src13mp|4.1}} | ||
* [[$phong#Masking|$phongexponentfactor]] From {{src13mp | * [[$phong#Colors|$phongalbedoboost]] {{csgo|since}} | ||
* [[$phong#Colors|$phongalbedoboost]] | * [[$phong#Masking|$basemapluminancephongmask]] {{as|since}} | ||
* [[$phong#Masking|$basemapluminancephongmask]] | **{{LUX|2}} allows the use of Rec. 709 HDTV Luminance Weights. <code>float3(0.2126f, 0.7152f, 0.0722f)</code>.<br>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|4.1}} | |||
** 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. | |||
* [[Glowing_Textures#.24selfillum|$selfillumtexture]] Deprecated since {{src07}} | : {{seealso|PBR Shaders in the community commonly have a $emissiontexture parameter that does EXACTLY what [[Glowing_Textures#.24selfillum|$selfillumtexture]] does in {{LUX|4.1}}.}} | ||
* {{Ent|$flowmap}} support - From {{as|4.1}} | |||
:{{seealso|PBR Shaders in the community commonly have a $emissiontexture parameter that does EXACTLY what [[Glowing_Textures#.24selfillum|$selfillumtexture]] does in {{LUX| | * {{Ent|$envmaplightscale}} From for brushes {{as|since}} '''and''' models {{csgo|only}} | ||
* | : | ||
* {{ | {{ModernImportant|Features are dependant on types: | ||
:{{ | * 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, this will use the Lightmap, regardless of if {{Ent|$bumpmap}} is used.}} | |||
=== Features that '''won't''' be ported/recreated/revived === | |||
* $basealphaenvmapmaskminmaxexp from {{as|4.1}} - This parameter is not yet documented on the VDC, it is also unclear what exactly it does... | |||
* $EnvMapLightScaleMinMax from {{csgo|4.1}} | |||
* {{Ent|$envmapsphere}} and related - These features have been removed since {{as|4.1}} and is obsolete. | |||
** This is very easy to re-implement. The 7th face of a [[cubemap]] is still built in {{src13|4.1}}, so this feature is still operational. | |||
=== Not functional for now === | |||
* $basealphaenvmapmaskminmaxexp from {{as}} - This parameter is not yet documented on the VDC, it is also unclear what exactly it does... | * {{Ent|$distancealpha}} - Non-Functional. Planned for later. | ||
* $EnvMapLightScaleMinMax from {{csgo}} | |||
* {{ | |||
* {{ | |||
* {{ | |||
=Stock Shaders VS LUX= | = Stock Shaders VS LUX = | ||
{{ | {{Todo|Move This to their own pages or something like that. Also, update.}} | ||
<br> | <br> | ||
== | == [[LightmappedGeneric]] == | ||
{| cellspacing="0" | |||
|- valign="top" | |||
| style="width:50%; padding-right:2em" | | |||
=== Stock Shaders === | === Stock Shaders === | ||
{{ | {{bug|hidetested=1| | ||
[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}} 2-9 Don't work.<br> | [[$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]] ({{as}}) 6 Doesn't work.<br> | ||
[[$detail#Parameters and Effects|$detailblendmode]]{{csgo}} | [[$detail#Parameters and Effects|$detailblendmode]] ({{csgo}}) 8 doesn't work. 9 doesn't work with {{Ent|$bumpmap}}, {{Ent|$envmap}} or {{Ent|$selfillum}}<br> | ||
{{ | {{Ent|$bumpmap}} + {{Ent|$envmapmask}} Doesn't work, except in {{csgo}}<br> | ||
{{ | {{Ent|$lightwarptexture}} + {{Ent|$detail}} ({{tf2}}{{as}}) Doesn't work.<br> | ||
{{ | {{Ent|$basealphaenvmapmask}} + {{Ent|bumpmap}} Doesn't work}} | ||
[[Glowing_Textures#.24selfillum|$selfillummask]] {{src13|not}}<br> | |||
[[Glowing_Textures#.24selfillum|$selfillummask]] | {{Ent|$selfillum_envmapmask_alpha}} {{src13|not}}<br> | ||
{{ | [[Glowing_Textures#.24selfillum|$selfillumfresnel]] {{src13|not}}<br> | ||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] | {{Ent|$blendtintbybasealpha}} {{src13|not}}<br> | ||
{{ | [[$detail#Parameters and Effects|$detailtexturetransform]] {{src13|not}}<br> | ||
[[$detail#Parameters and Effects|$detailtexturetransform]] | {{Ent|$lightwarptexture}}{{csgo|not}}<br> | ||
{{ | {{Ent|$envmapfresnelminmaxexp}}{{l4d|since}}<br> | ||
{{ | {{Ent|$envmaplightscale}}{{as|since}}<br> | ||
{{ | {{Ent|$basealphaenvmapmask}} requires inverted masks | ||
| style="width:50%"| | |||
=== {{LUX}}LUX_LightMappedGeneric === | === {{LUX}}LUX_LightMappedGeneric === | ||
{{ | {{Note| | ||
[[$detail#Parameters and Effects|$detailblendmode]] 1-9 works.<br> | [[$detail#Parameters and Effects|$detailblendmode]] 1-9 works.<br> | ||
[[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned.<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<br> | ||
{{ | {{Ent|$basealphaenvmapmask}} + {{Ent|$bumpmap}} works.<br> | ||
[[Glowing_Textures#.24selfillum|$selfillummask]] Exists now.<br> | [[Glowing_Textures#.24selfillum|$selfillummask]] Exists now.<br> | ||
{{ | {{Ent|$blendtintbybasealpha}} Exists now.<br> | ||
{{ | {{Ent|$selfillum_envmapmask_alpha}} Exists now.<br> | ||
{{Ent|$envmaplightscale}} Exists now.<br> | |||
[[$detail#Parameters and Effects|$detailtexturetransform]] Exists now.}} | [[$detail#Parameters and Effects|$detailtexturetransform]] Exists now.}} | ||
Line 158: | Line 152: | ||
:{{Notice|Caveat - [[Glowing_Textures#.24selfillum|$selfillumtexture]] has higher priority than both.}} | :{{Notice|Caveat - [[Glowing_Textures#.24selfillum|$selfillumtexture]] has higher priority than both.}} | ||
{{ | {{ModernImportant|{{Ent|$basealphaenvmapmask}} does not require a flipped mask.}} | ||
:{{ | :{{workaround|There is a new parameter that can flip the envmap mask. It also works with {{Ent|$envmapmask}} and {{Ent|$normalmapalphaenvmapmask}}.}} | ||
|} | |||
== VertexLitGeneric == | |||
== [[VertexLitGeneric]] == | |||
{| cellspacing="0" | |||
|- valign="top" | |||
| style="width:50%; padding-right:2em" | | |||
=== Stock Shaders === | === Stock Shaders === | ||
==== Always ==== | ==== Always ==== | ||
{{ | {{Ent|$envmaplightscale}}{{only|{{csgo}}}}. | ||
==== Without $Bumpmap ==== | ==== Without $Bumpmap ==== | ||
{{ | {{bug|hidetested=1|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 10-11 Don't work.<br> | ||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] missing.<br> | [[Glowing_Textures#.24selfillum|$selfillumfresnel]] missing.<br> | ||
{{ | {{Ent|$lightwarptexture}} missing.}} | ||
{{ | {{Note|$lightwarptexture forces bumpmapping by binding a default one, unless one is manually specified.}} | ||
==== '''With''' $Bumpmap ==== | ==== '''With''' $Bumpmap ==== | ||
{{ | {{bug|hidetested=1| | ||
[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 5-11 Don't work.<br> | [[$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.}} | [[$detail#Parameters and Effects|$detailblendmode]]{{csgo}} 5-6 & 8-11 Don't work.}} | ||
{{ | {{Note| | ||
{{ | {{Ent|$envmapmask}} missing. Except {{mapbase}}.<br> | ||
[[Glowing_Textures#.24selfillum|$selfillummask]] missing. {{ModernConfirm|Only in {{mapbase}}?}} | [[Glowing_Textures#.24selfillum|$selfillummask]] missing. {{ModernConfirm|Only in {{mapbase}}?}} | ||
{{ | {{Ent|$selfillum_envmapmask_alpha}}{{mapbase}} missing.<br> | ||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] disables {{ | [[Glowing_Textures#.24selfillum|$selfillumfresnel]] disables {{Ent|$normalmapalphaenvmapmask}}. {{todo|Also on other branches than {{as}}?}}}} | ||
==== With $Phong ==== | ==== With $Phong ==== | ||
{{ | {{bug|hidetested=1|[[$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 {{ | [[$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> | [[$phong#Colors|$phongalbedotint]] cannot be used without [[$phong#Masking|$phongexponenttexture]].<br> | ||
{{ | {{Ent|$phongwarptexture}}{{l4d2}} does not work.<br> | ||
[[$phong#Colors|$phongalbedoboost]]{{only|{{csgo}}}} + {{ | [[$phong#Colors|$phongalbedoboost]]{{only|{{csgo}}}} + {{Ent|$detail}} does not work.<br> | ||
[[$phong#Colors|$phongtint]] disables [[$phong#Colors|$phongalbedotint]].<br> | [[$phong#Colors|$phongtint]] disables [[$phong#Colors|$phongalbedotint]].<br> | ||
{{ | {{Ent|$envmap}} always masked by something.<br> | ||
{{Only in {{l4d}}+ {{ | {{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 {{ | [[$phong#Masking|$basemapalphaphongmask]] makes {{Ent|$phong}} ignore the {{Ent|$bumpmap}}.<br> | ||
[[Glowing_Textures#.24selfillum|$selfillumfresnel]] + {{ | [[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 {{ | [[Glowing_Textures#.24selfillum|$selfillumfresnel]] will cause {{Ent|$envmap}} to be masked using the {{Ent|$basetexture}} alpha channel.}}}} | ||
{{ | {{Note|[[$phong#Brightness|$phongdisablehalflambert]]{{as|since}}<br> | ||
[[$phong#Masking|$phongexponentfactor]] only in {{tf2}}{{src13mp}}<br> | [[$phong#Masking|$phongexponentfactor]] only in {{tf2}}{{src13mp}}<br> | ||
[[$phong#Masking|$basemapluminancephongmask]] | [[$phong#Masking|$basemapluminancephongmask]]{{l4d|since}}<br> | ||
[[$phong#Colors|$phongalbedoboost]] only in {{csgo}} | [[$phong#Colors|$phongalbedoboost]] only in {{csgo|since}}}} | ||
| width="50%" | | |||
=== {{LUX}}LUX_VertexLitGeneric === | === {{LUX}}LUX_VertexLitGeneric === | ||
==== Without $Bumpmap ==== | ==== Without $Bumpmap ==== | ||
* [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | * [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | ||
* [[Glowing_Textures#.24selfillum|$selfillumfresnel]] Exists now.<br> | * [[Glowing_Textures#.24selfillum|$selfillumfresnel]] Exists now.<br> | ||
* {{ | * {{Ent|$lightwarptexture}} Exists now.<br> | ||
::{{ | ::{{todo|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> | ||
* [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | * [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | ||
* {{ | * {{Ent|$envmapmask}} Exists now.<br> | ||
* [[Glowing_Textures#.24selfillum|$selfillummask]] Exists now.<br> | * [[Glowing_Textures#.24selfillum|$selfillummask]] Exists now.<br> | ||
* {{ | * {{Ent|$selfillum_envmapmask_alpha}} Exists now.<br> | ||
* [[Glowing_Textures#.24selfillum|$selfillumfresnel]] + {{ | * [[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> | ||
* [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | * [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | ||
{{ | {{Note|[[$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]].}} | [[$phong#Colors|$phongalbedotint]] can now be used without [[$phong#Masking|$phongexponenttexture]].}} | ||
:{{Notice|Will use entirety of {{ | :{{Notice|Will use entirety of {{Ent|$basetexture}}, without being masked.}} | ||
* [[$phong#Colors|$phongwarptexture]] | * [[$phong#Colors|$phongwarptexture]] Works ( {{not|l4d2|4.1}} ).<br> | ||
* [[$phong#Colors|$phongalbedoboost]] Exists now. Used to be {{only|{{csgo}}.}} | * [[$phong#Colors|$phongalbedoboost]] Exists now. Used to be {{only|{{csgo}}.}} | ||
* [[$phong#Colors|$phongalbedoboost]] + {{ | * [[$phong#Colors|$phongalbedoboost]] + {{Ent|$detail}} Works. Does not work in {{csgo|4.1}}.<br> | ||
{{ | {{Note|[[$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!}} | :{{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>) | ||
: {{ | : {{ModernImportant|By default the original masking for the $envmap will be replicated to not have disparity. However, it can now be overridden using two new parameters. <code>$phongforcebasealphaenvmapmask</code> and <code>$phongforcenormalmapalphaenvmapmask</code>}} | ||
* [[$phong#Masking|$basemapalphaphongmask]] '''no longer''' makes {{ | * [[$phong#Masking|$basemapalphaphongmask]] '''no longer''' makes {{Ent|$phong}} ignore the {{Ent|$bumpmap}}. | ||
:{{Notice|This will make materials that previously used this intentionally, look different.}} | :{{Notice|This will make materials that previously used this intentionally, look different.}} | ||
* [[Glowing_Textures#.24selfillum|$selfillumfresnel]] + {{ | * [[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}}+}} | ||
* [[$phong#Masking|$phongexponentfactor]] Exists now for {{src13sp}}. ( Used to be {{only|{{tf2}}{{src13mp}}}} | * [[$phong#Masking|$phongexponentfactor]] Exists now for {{src13sp}}. ( Used to be {{only|{{tf2}}{{src13mp}}}}) | ||
* [[$phong#Masking|$basemapluminancephongmask]] Exists now. ( Used to be {{ | * [[$phong#Masking|$basemapluminancephongmask]] Exists now. ( Used to be {{since|l4d}}) | ||
* [[$phong#Colors|$phongalbedoboost]] Exists now. ( Used to be {{ | * [[$phong#Colors|$phongalbedoboost]] Exists now. ( Used to be {{since|csgo}}) | ||
|} | |||
==History== | == History == | ||
{{LUX| | {{LUX|4.1}} started development on January 20th, 2023, but it was planned and thought around January 14th, when the lead developer [[User:ShiroDkxtro2|ShiroDkxtro2]] was in a hospital stay.<br> | ||
Even before 2023, the idea of | Even before 2023, the idea of rewriting Valve's shaders was being considered. Various people asked [[User:ShiroDkxtro2|ShiroDkxtro2]] if certain modifications could be implemented for default shaders, such as cascaded shadow mapping.<br> | ||
These requests would usually result in a simple "no | These requests would usually result in a simple "no", as modifying the default shaders was not considered feasible for various reasons, most of which are indirectly mentioned in [[LUX#Goals|LUX's Goals]].<br> | ||
The | The project's inception was supposed to be a means to make the existing shaders more moddable, with new features in mind and laid out so that implementing new things would be easier.<br> | ||
==Credits== | == Credits == | ||
;[https://github.com/SCell555/ShaderCompile SCell555's ShaderCompiler] | |||
:Used to compile the Shaders. Include files ( .inc ) are intended to be made using [https://strawberryperl.com/ Perl]. | |||
:{{LUX|4.1}} copies various code from [https://github.com/thexa4/source-pbr thexa4's PBR header]<br> | |||
;Tottery ( Also known as TotteryNine ) | |||
:TotteryNine was crucial to [[User:ShiroDkxtro2|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. | |||
;[[User:Ficool2|Ficool2]] | |||
For | :For enlightening us about the Constant Register Hack, allowing for the use of more than 32 float constant registers on SM3.0<br> | ||
:This Project would be nearly impossible without it. | |||
;ChatGPT | |||
:Help with programming and the undocumented graphical features of the Source Engine. | |||
:It knows things and can make new things to a degree. Various code used in {{LUX|2}} has been partially written by AI. | |||
;{{mapbase|4.1}} | |||
: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 inherited with the credits of {{LUX|2}}. You can find Mapbase's credits [https://github.com/mapbase-source/source-sdk-2013/wiki/Mapbase-Credits here]. | |||
;[https://github.com/Joshua-Ashton/Source-PlusPlus/ Source++] | |||
:Code might be included, like the NvidiaPCF5x5Gaussian Shadow Filter | |||
;Joshua Ashton | |||
:For his various open-source work related to the Source Engine | |||
==See also== | == See also == | ||
* {{LUX| | * {{LUX|4.1}} [https://discord.gg/cGv8GGSkpc Discord] Server | ||
:Development can be followed here, Bug-Reports & suggestions made. | : Development can be followed here, Bug-Reports & suggestions made. | ||
:It is also intended as a general place for discussing {{src13| | : It is also intended as a general place for discussing {{src13|4.1}} related Shader-Modding. | ||
* {{LUX| | * {{LUX|4.1}} [https://github.com/ShiroDkxtro2/ACROHS-LUX_-Shaders-Project GitHub] page | ||
{{ | {{Todo|Make a new category for LUX_ Shaders and document them and their parameters there, instead of here. Preferably after they were released on the GitHub.}} |
Latest revision as of 07:20, 20 May 2025
LUX | |
---|---|
![]() | |
Wiki | |
Type | Modification |
Developers | ShiroDkxtro2 |
Engine | ![]() |
Platforms | ![]() |
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
- Overhaul/Clean
materialsystem\stdshaders\
Folder - Implementing
LUX Shaders would entail replacing the existing
stdshaders\
folder.LUX Shaders should be able to do everything SDK_ Shaders in
and
can do.
- SDK_ Shaders will fall back to LUX_ Shaders, that way
LUX can easily be used on
Mapbase mods without much work.
- Many .h, .cpp, .fxc files have been rewritten
- Drastically decrease compile times for all Shaders
- With
LUX, compiling the entirety of LUX_LightMappedGeneric takes around 30 seconds on 4 cores @4.1GHz
- SM3.0 Shaders Only
Linux and
macOS are not officially supported. Users of said systems will have to either patch
togl
to work with SM3.0 or use DxVK.Note:
- 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.
- More Documentation for Shaders, their parameters, how they work and any possible caveats
- You might have noticed Articles like $lightwarptexture, $detail, UnlitTwoTexture and $envmapmask getting major updates with new information about caveats and bugs.
- This was a direct result of
LUX development, although the focus was mainly on
and
as their code is publicly available.
- 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
).
- Fixing most Parameter bugs and other caveats
- See also: Stock Shaders VS LUX
- Easy way of disabling features
- A custom Pre-Processor program has been made, allowing Mods that don't require specific features to easily disable them and further increase Shader compilation speed.
Mapbase compatibility
- Replacing SDK_ Shaders in SDK mods, SDK2013CE or Mapbase mods should be as simple as replacing the
stdshaders\
Folder, assuming that no custom shaders were added. If they were added, developers may need to add them back or recreate them.
Planned Features
This is a list of new features that are being implemented / will be implemented from newer branches such as:
The code may be modified for simplification or if it needs a overhaul



Warning:For more complicated features, there might be visual disparity when compared to official implementations.
Mapbase compatibility


- $phongdisablehalflambert, ported from the
Alien Swarm engine branch
- Radial Fog for all "Geometry" Shaders
- Spline-Ropes
- Parallax Corrected Cubemaps
- Just like with
Mapbase, this will require a custom compiler to work.
- Just like with
- $envmapmask + $bumpmap on VertexLitGeneric
- Replacement for the "Postprocessing" Controller Shader
- Replacement for the "Engine_post" Shader from
- Hammer $blendmodulatetexture previewing fix.
- Brush $phong
- Treesway
Confirm:Is the
Mapbase implementation ported from
Alien Swarm?
- $bumpmask and related
New features
- In
Source 2013 Multiplayer, models utilizing Model Lightmapping can use $bumpmap. Additionally, all Model shaders will be able to utilize this feature, unless they have $phong.
- The Lightmap does not do bumped-lighting using the bumpmap. Only named lights/projected textures will be able to do so.
- Lightmapped models will not be able to receive $phong. This is not planned at the moment but should be possible for named lights/projected textures!
- In
Models can utilize Lightmap UV's.
- The way this is currently implemented requires a custom-written tool, two SMDs (one with a lightmap uv), and also has a lot of precision loss for the Lightmap UVs. Additionally, this requires a custom compiler! Todo: Investigate
Source 2007 code, supposedly the Studiomdl code is there. Maybe it can be packed via Blendweights or the precision loss might be decreased.
- The way this is currently implemented requires a custom-written tool, two SMDs (one with a lightmap uv), and also has a lot of precision loss for the Lightmap UVs. Additionally, this requires a custom compiler!
Features ported/recreated
- $phongdisablehalflambert (in all games since
) - Also needed for
Mapbase
- $phongexponentfactor From
Source 2013 Multiplayer
- $phongalbedoboost (in all games since
)
- $basemapluminancephongmask (in all games since
)
LUX allows the use of Rec. 709 HDTV Luminance Weights.
float3(0.2126f, 0.7152f, 0.0722f)
.
Previously, SDK_ Shaders would use the NTSC Analog Television standard offloat3(0.2990f, 0.5870f, 0.1140f)
- $selfillumtexture Deprecated since
Source 2007
- Yes, there is a use for this! $detailblendmode 5 is commonly used for glowing textures. This parameter allows for not wasting your $detail. Additionally no $emissiveblend is required.
- See also: PBR Shaders in the community commonly have a $emissiontexture parameter that does EXACTLY what $selfillumtexture does in
LUX.
- $flowmap support - From
Alien Swarm
- $envmaplightscale From for brushes (in all games since
) and models (only in
)

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
- $envmapsphere and related - These features have been removed since
Alien Swarm and is obsolete.
- This is very easy to re-implement. The 7th face of a cubemap is still built in
Source 2013, so this feature is still operational.
- This is very easy to re-implement. The 7th face of a cubemap is still built in
Not functional for now
- $distancealpha - Non-Functional. Planned for later.
Stock Shaders VS LUX
LightmappedGeneric
Stock Shaders![]() $detailblendmode ( $selfillummask (not in |
|
VertexLitGeneric
Stock ShadersAlways$envmaplightscale(only in Without $Bumpmap![]() ![]() ![]() ![]() ![]() $selfillumfresnel missing. ![]()
With $Bumpmap![]() $detailblendmode ![]() ![]() $envmapmask missing. Except $selfillum_envmapmask_alpha
With $Phong![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() $phongalbedotint cannot be used without $phongexponenttexture. ![]() ![]() $phongexponentfactor only in ![]() |
|
History
LUX started development on January 20th, 2023, but it was planned and thought around January 14th, when the lead developer ShiroDkxtro2 was in a hospital stay.
Even before 2023, the idea of rewriting Valve's shaders was being considered. Various people asked ShiroDkxtro2 if certain modifications could be implemented for default shaders, such as cascaded shadow mapping.
These requests would usually result in a simple "no", as modifying the default shaders was not considered feasible for various reasons, most of which are indirectly mentioned in LUX's Goals.
The project's inception was supposed to be a means to make the existing shaders more moddable, with new features in mind and laid out so that implementing new things would be easier.
Credits
- SCell555's ShaderCompiler
- 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.
- Ficool2
- For enlightening us about the Constant Register Hack, allowing for the use of more than 32 float constant registers on SM3.0
- This Project would be nearly impossible without it.
- ChatGPT
- Help with programming and the 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 partially written by AI.
Mapbase
- 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 inherited with the credits of
LUX. You can find Mapbase's credits here.
- Source++
- Code might be included, like the NvidiaPCF5x5Gaussian Shadow Filter
- Joshua Ashton
- 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.