Zh/LUX: Difference between revisions
< Zh
Jump to navigation
Jump to search
(Created page with "{{lang}} {{infotable |state=5 |ownwiki=https://github.com/ShiroDkxtro2/ACROHS-LUX_-Shaders-Project/wiki |type=m0 |dev=ShiroDkxtro2 |engine=2 |base={{src...") |
mNo edit summary |
||
Line 17: | Line 17: | ||
==目标== | ==目标== | ||
* '''大修\清理<code>materialsystem\stdshaders\</code>目录''' | * '''大修\清理<code>materialsystem\stdshaders\</code>目录''' | ||
:{{ | :{{warning:zh-cn|除了现有的着色器编译功能外,几乎所有的东西都被“扬了”。}} | ||
:{{notice:zh-cn|实现{{LUX|2}}的着色器需要将<code>stdshaders/</code>替换为{{LUX|2}}自己的,这“有效”的扬了所有原版着色器的修改版,LUX应该能够实现所有{{src13}}和{{Mapbase}}着色器原有的功能}} | :{{notice:zh-cn|实现{{LUX|2}}的着色器需要将<code>stdshaders/</code>替换为{{LUX|2}}自己的,这“有效”的扬了所有原版着色器的修改版,LUX应该能够实现所有{{src13}}和{{Mapbase}}着色器原有的功能}} | ||
::{{ | ::{{note:zh-cn|SDK着色器会自动回退到对应的{{LUX|2}}版本,这样使用{{Mapbase|4}}的模组无需太多改动就可以使用LUX}} | ||
* '''大幅减少所有着色器的编译时间''' | * '''大幅减少所有着色器的编译时间''' | ||
:{{why:zh-cn|在{{src13sp}}{{src13mp}}{{as}},V社的着色器需要'''非常长'''的时间进行编译。尤其是在使用原版编译器的情况下。这限制了着色器的修改}} | :{{why:zh-cn|在{{src13sp}}{{src13mp}}{{as}},V社的着色器需要'''非常长'''的时间进行编译。尤其是在使用原版编译器的情况下。这限制了着色器的修改}} | ||
Line 25: | Line 25: | ||
* '''着色器仅使用SM 3.0''' | * '''着色器仅使用SM 3.0''' | ||
:{{why:zh-cn|ps20b及以下有太多限制。缺少可用的常量寄存器会导致极端分支和大量“组合”。使代码变成一坨难以阅读和理解的屎山。这会抑制模组制作者的积极性。}} | :{{why:zh-cn|ps20b及以下有太多限制。缺少可用的常量寄存器会导致极端分支和大量“组合”。使代码变成一坨难以阅读和理解的屎山。这会抑制模组制作者的积极性。}} | ||
:{{ | :{{note:zh-cn|SM3.0于2004年发布,[https://cdn.cloudflare.steamstatic.com/apps/valve/2010/siggraph2010_vlachos_waterflow.pdf V社在2008年考虑到了ps2.0及以下的低端硬件]。详见幻灯片第8页}} | ||
:{{ | :{{note:zh-cn|这意味着不支持SM3.0的低端硬件将无法使用新的着色器}} | ||
:{{notice:zh-cn|Linux和MacOS暂无官方支持。以上系统用户需要使用<code>togl</code>进行补丁才能使用SM3.0,或使用DXVK}} | :{{notice:zh-cn|Linux和MacOS暂无官方支持。以上系统用户需要使用<code>togl</code>进行补丁才能使用SM3.0,或使用DXVK}} | ||
* '''完全重写.h, .cpp, .fxc文件''' | * '''完全重写.h, .cpp, .fxc文件''' | ||
Line 32: | Line 32: | ||
:{{notice:zh-cn|你可能已经注意到了如{{ent|$lightwarptexture}}、{{ent|$detail}}、{{ent|UnlitTwoTexture}}、{{ent|$envmapmask}}得到了由[[User:ShiroDkxtro2|ShiroDkxtro2]]贡献的重大更新 | :{{notice:zh-cn|你可能已经注意到了如{{ent|$lightwarptexture}}、{{ent|$detail}}、{{ent|UnlitTwoTexture}}、{{ent|$envmapmask}}得到了由[[User:ShiroDkxtro2|ShiroDkxtro2]]贡献的重大更新 | ||
:他为{{tf2}}{{as}}{{src13}}{{csgo}}添加了新的注意事项和bug记录。这些文档是{{LUX|2}}开发的直接结果,尽管开发的重点集中在{{src13}}{{as}}上,因为他们是开源项目}} | :他为{{tf2}}{{as}}{{src13}}{{csgo}}添加了新的注意事项和bug记录。这些文档是{{LUX|2}}开发的直接结果,尽管开发的重点集中在{{src13}}{{as}}上,因为他们是开源项目}} | ||
:{{ | :{{note:zh-cn|目前缺少有关着色器如何在起源中工作的文档,这导致起源的图形学领域门槛很高,需要有大量的相关经验,阻碍了模组制作者们修改着色器和创作自己的}} | ||
* '''实现{{src13}}没有的内容''' | * '''实现{{src13}}没有的内容''' | ||
:{{Seealso:zh-cn| <code>计划实现的功能</code>. 这个目标包含了例如[[Glowing_Textures#.24selfillum|$selfillumtexture]]的旧功能和例如[[$phong#Colors|$phongalbedoboost]]{{only|csgo}}的新功能}} | :{{Seealso:zh-cn| <code>计划实现的功能</code>. 这个目标包含了例如[[Glowing_Textures#.24selfillum|$selfillumtexture]]的旧功能和例如[[$phong#Colors|$phongalbedoboost]]{{only|csgo}}的新功能}} | ||
Line 38: | Line 38: | ||
:{{Seealso:zh-cn| <code>原版着色器与LUX着色器对比</code>}} | :{{Seealso:zh-cn| <code>原版着色器与LUX着色器对比</code>}} | ||
* '''禁用特定功能的简单方法''' <!--原文为It automatically sets <code>// STATIC:</code>'s to predefined values depending on <code>#define</code>'s in an included header file,出于通俗目的进行修改--> | * '''禁用特定功能的简单方法''' <!--原文为It automatically sets <code>// STATIC:</code>'s to predefined values depending on <code>#define</code>'s in an included header file,出于通俗目的进行修改--> | ||
:{{ | :{{note:zh-cn|已制作一个自定义的预处理程序,可以通过禁用不需要的功能来使着色器编译的更快}} | ||
* '''对Mapbase的兼容性''' | * '''对Mapbase的兼容性''' | ||
:{{notice:zh-cn|要替换其他mod(如Source 2013社区版,以Mapbase为本体的mod)修改的原版着色器,应该和直接替换<code>stdshaders\</code>目录一样简单}} | :{{notice:zh-cn|要替换其他mod(如Source 2013社区版,以Mapbase为本体的mod)修改的原版着色器,应该和直接替换<code>stdshaders\</code>目录一样简单}} | ||
:{{ | :{{note:zh-cn| 以上假定除修改的原版着色器外无其他的自定义着色器,但如果确实有,开发者应该能将它们添加回来,因为这是添加自定义着色器的先决条件}} | ||
==计划实现的功能== | ==计划实现的功能== | ||
这是正在实施的新功能列表,或者将从较新的引擎分支移植/复刻的功能,例如{{as}}{{l4d2}}{{csgo}} | 这是正在实施的新功能列表,或者将从较新的引擎分支移植/复刻的功能,例如{{as}}{{l4d2}}{{csgo}} | ||
{{ | {{note:zh-cn|该语境下的被移植“对象”通常指{{as|4}}{{mapbase|4}},但在多数情况下,其代码会出于简化或大修的目的而进行大量修改}} | ||
{{important:zh-cn|{{LUX|2}}'''不使用'''''任何''的泄露代码。像[[$phong#Colors|$phongalbedoboost]]{{only|csgo}}这样的功能不是什么难以实现的东西,它们可以在不使用泄露代码的情况下安全的复现}} | {{important:zh-cn|{{LUX|2}}'''不使用'''''任何''的泄露代码。像[[$phong#Colors|$phongalbedoboost]]{{only|csgo}}这样的功能不是什么难以实现的东西,它们可以在不使用泄露代码的情况下安全的复现}} | ||
:{{ | :{{warning:zh-cn|对于更复杂的功能,与V社的实现方法相比可能存在视觉差异。}} | ||
====出于{{mapbase|4}}而需实现的功能==== | ====出于{{mapbase|4}}而需实现的功能==== | ||
Line 54: | Line 54: | ||
* Spline-Ropes | * Spline-Ropes | ||
* [[Parallax Corrected Cubemaps|视差修正反射贴图]] | * [[Parallax Corrected Cubemaps|视差修正反射贴图]] | ||
:{{ | :{{note:zh-cn|就像{{mapbase|4}}一样,视差反射需要自定义的地图编译器}} | ||
:{{important:zh-cn|{{LUX}}和{{mapbase}}参数是一样的,所以Mapbase的地图编译器也可以使用}} | :{{important:zh-cn|{{LUX}}和{{mapbase}}参数是一样的,所以Mapbase的地图编译器也可以使用}} | ||
* {{ent|VertexLitGeneric}}上同时使用{{ent|$envmapmask|反射遮罩}}和{{ent|$bumpmap|法线贴图}}的支持 | * {{ent|VertexLitGeneric}}上同时使用{{ent|$envmapmask|反射遮罩}}和{{ent|$bumpmap|法线贴图}}的支持 | ||
Line 63: | Line 63: | ||
* [[$treesway|树叶飘动]] | * [[$treesway|树叶飘动]] | ||
:{{todo|这真的是移植自{{as}}的{{mapbase}}功能吗}} | :{{todo|这真的是移植自{{as}}的{{mapbase}}功能吗}} | ||
==== 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}}. | |||
:{{important:zh-cn|The Lightmap does not do bumped-lighting using the bumpmap. Only named-lights/projected textures will be able to do so.}} | |||
:{{note:zh-cn| 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. | |||
:{{warning:zh-cn|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! }} | |||
::{{todo|Investigate {{src07}} code, supposedly the Studiomdl code is there. Maybe it can be packed via Blendweights or alternatively the precision loss might be decreased.}} | |||
==== Features ported/recreated/revived ==== | |||
* [[$phong#Brightness|$phongdisablehalflambert]] From {{as}}+ - Also needed for {{mapbase}} | |||
* [[$phong#Masking|$phongexponentfactor]] From {{src13mp}}{{tf2}}, with LUX also on {{src13sp}} | |||
* [[$phong#Colors|$phongalbedoboost]] From {{csgo}} - Its just <code>BaseTexture * $PhongAlbedoBoost</code>... No leaked code! | |||
* [[$phong#Masking|$basemapluminancephongmask]] From {{as}}+ | |||
:{{note:zh-cn|LUX 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}} - This used to be obsolete | |||
:{{note:zh-cn| 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:zh-cn|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}} | |||
* {{ent|$envmaplightscale}} From {{as}} for brushes{{as}}+ AND models {{only|{{csgo}}}}+ | |||
:{{important:zh-cn}} | |||
:: * 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. | |||
==== Features that are being discarded ==== | |||
* {{ent|$envmapsphere}} and related - These features have been removed since {{as}} and are obsolete. | |||
:{{note:zh-cn|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 | |||
==== 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... | |||
* $EnvMapLightScaleMinMax from {{csgo}} | |||
==== Not functional - FOR NOW ==== | |||
* {{ent|$emissiveblend}} - Non-Existant. Planned for later. | |||
* {{ent|$distancealpha}} - Non-Functional. Planned for later. | |||
* {{ent|$ssbump}} - Non-Functional. Planned for later. | |||
* [[$detail#Parameters and Effects|$detailblendmode]] <code>10 & 11</code>. - Non-Functional. Planned for later. | |||
<br> | |||
=Stock Shaders VS LUX= | |||
{{todo|Move This to their own pages or something like that.}} | |||
== LightMappedGeneric == | |||
=== Stock Shader's === | |||
{{bug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}} 2-9 Don't work.}} | |||
{{bug|[[$detail#Parameters and Effects|$detailblendmode]]{{as}} 6 Doesn't work.}} | |||
{{bug|[[$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> | |||
{{bug|{{ent|$bumpmap}} + {{ent|$envmapmask}} Doesn't work, except in {{csgo|4}}}} | |||
{{bug|{{ent|$lightwarptexture}} + {{ent|$detail}}{{tf2}}{{as}} Doesn't work}} | |||
{{bug|{{ent|$basealphaenvmapmask}} + {{ent|bumpmap}} Doesn't work}} | |||
<br> | |||
{{note:zh-cn|[[Glowing_Textures#.24selfillum|$selfillummask]] Missing}} | |||
{{note:zh-cn|{{ent|$selfillum_envmapmask_alpha}} Missing}} | |||
{{note:zh-cn|[[Glowing_Textures#.24selfillum|$selfillumfresnel]] Missing}} | |||
{{note:zh-cn|{{ent|$blendtintbybasealpha}} Missing}} | |||
{{note:zh-cn|[[$detail#Parameters and Effects|$detailtexturetransform]] Missing}} | |||
{{note:zh-cn|{{ent|$lightwarptexture}}{{csgo}} Missing}} | |||
{{note:zh-cn|{{ent|$envmapfresnelminmaxexp}}{{only|{{l4d}}+}}}} | |||
{{note:zh-cn|{{ent|$envmaplightscale}}{{only|{{as}}+}}}} | |||
{{notice:zh-cn|{{ent|$basealphaenvmapmask}} requires inverted masks}} | |||
=== LUX_LightMappedGeneric === | |||
* [[$detail#Parameters and Effects|$detailblendmode]] 1-9 works. | |||
* [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. | |||
* {{ent|$bumpmap}} + {{ent|$envmapmask}} works, used to be {{only|{{csgo}}.}} | |||
* {{ent|$lightwarptexture}} + {{ent|$detail}} works ( does not work in {{as}}{{tf2}} ). | |||
* {{ent|$basealphaenvmapmask}} + {{ent|$bumpmap}} works. | |||
* [[Glowing_Textures#.24selfillum|$selfillummask]] Exists now. | |||
* {{ent|$blendtintbybasealpha}} Exists now. | |||
* {{ent|$selfillum_envmapmask_alpha}} Exists now. | |||
* [[$detail#Parameters and Effects|$detailtexturetransform]] Exists now. | |||
::{{notice:zh-cn|Caveat - Has higher priority than [[Glowing_Textures#.24selfillum|$selfillum]]/[[Glowing_Textures#.24selfillum|$selfillummask]].}} | |||
:::{{notice:zh-cn|Caveat - [[Glowing_Textures#.24selfillum|$selfillumtexture]] has higher priority than both.}} | |||
:{{important:zh-cn|{{ent|$basealphaenvmapmask}} does no longer require a flipped mask.}} | |||
::{{workaround|Materials that previously used have to be adjusted. Use {{ent|$envmapmask}} or {{ent|$normalmapalphaenvmapmask}} instead! }} | |||
== VertexLitGeneric == | |||
=== Stock Shader's === | |||
==== Always ==== | |||
{{ent|$envmaplightscale}}{{only|{{csgo}}}}. | |||
==== Without $Bumpmap ==== | |||
{{bug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 10-11 Don't work.}} | |||
{{bug|[[Glowing_Textures#.24selfillum|$selfillumfresnel]] missing.}} | |||
{{bug|{{ent|$lightwarptexture}} missing.}} | |||
:{{note:zh-cn|$lightwarptexture fores bumpmapping by binding a default one, unless one is manually specified.}} | |||
==== '''With''' $Bumpmap ==== | |||
{{bug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 5-11 Don't work.}} | |||
{{bug|[[$detail#Parameters and Effects|$detailblendmode]]{{csgo}} 5-6 & 8-11 Don't work.}} | |||
{{note:zh-cn|{{ent|$envmapmask}} missing. Except {{mapbase}}.}} | |||
{{note:zh-cn|[[Glowing_Textures#.24selfillum|$selfillummask]] missing. {{confirm|Only in {{mapbase}}?}}}} | |||
{{note:zh-cn|{{ent|$selfillum_envmapmask_alpha}}{{mapbase}} missing.}} | |||
{{bug|[[Glowing_Textures#.24selfillum|$selfillumfresnel]] disables {{ent|$normalmapalphaenvmapmask}}. {{todo|Also on other branches than {{as}}?}}}} | |||
==== With $Phong ==== | |||
{{bug|[[$detail#Parameters and Effects|$detailblendmode]]{{src13}}{{tf2}}{{as}}{{csgo}} 8-11 Don't work.}} | |||
{{bug|[[$phong#Masking|$invertphongmask]]{{as}}{{src13}} In the shadercode, only flips the mask used for {{ent|$envmap}}. {{confirm|Also on newer branches?}}}} | |||
{{bug|[[$phong#Colors|$phongalbedotint]] cannot be used without [[$phong#Masking|$phongexponenttexture]].}} | |||
{{bug|{{ent|$phongwarptexture}}{{l4d2}} does not work.}} | |||
{{bug|[[$phong#Colors|$phongalbedoboost]]{{only|{{csgo}}}} + {{ent|$detail}} does not work.}} | |||
{{bug|[[$phong#Colors|$phongtint]] disables [[$phong#Colors|$phongalbedotint]].}} | |||
{{bug|{{ent|$envmap}} always masked by something.}} | |||
{{bug|Only in {{l4d}}+ {{ent|$envmap}} masked by {{ent|$basetexture}} luminance when {{ent|$normalmapalphaenvmapmask}} and [[$phong#Masking|$basemapluminancephongmask]] is used.}} | |||
{{bug|{{ent|$envmap}} masked by {{ent|$basetexture}} alpha when {{ent|$normalmapalphaenvmapmask}} and [[$phong#Masking|$basemapalphaphongmask]] is used.}} | |||
{{bug|[[$phong#Masking|$basemapalphaphongmask]] makes {{ent|$phong}} ignore the {{ent|$bumpmap}}.}} | |||
{{bug|[[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.}} | |||
{{bug|[[Glowing_Textures#.24selfillum|$selfillumfresnel]] will cause {{ent|$envmap}} to be masked using the {{ent|$basetexture}} alpha channel}} | |||
{{note:zh-cn|[[$phong#Brightness|$phongdisablehalflambert]] only in {{as}}+}} | |||
{{note:zh-cn|[[$phong#Masking|$phongexponentfactor]] only in {{tf2}}{{src13mp}}}} | |||
{{note:zh-cn|[[$phong#Masking|$basemapluminancephongmask]] only in {{l4d}}+}} | |||
{{note:zh-cn|[[$phong#Colors|$phongalbedoboost]] only in {{csgo}}+}} | |||
=== LUX_VertexLitGeneric === | |||
==== Without $Bumpmap ==== | |||
* [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<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 ==== | |||
* [[$detail#Parameters and Effects|$detailblendmode]] 5-9 work.<br> | |||
* [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | |||
* {{ent|$envmapmask}} Exists now.<br> | |||
* [[Glowing_Textures#.24selfillum|$selfillummask]] Exists now.<br> | |||
* {{ent|$selfillum_envmapmask_alpha}} Exists now.<br> | |||
* [[Glowing_Textures#.24selfillum|$selfillumfresnel]] + {{ent|$normalmapalphaenvmapmask}} Works now.<br> | |||
==== With $Phong ==== | |||
* [[$detail#Parameters and Effects|$detailblendmode]] 8-9 work now.<br> | |||
* [[$detail#Parameters and Effects|$detailblendmode]] 10-11 planned. If possible.<br> | |||
* {{note:zh-cn|[[$phong#Masking|$invertphongmask]] Now only flips the mask used for phong. It will no longer touch the envmapmask ''at all''.}} | |||
* {{note:zh-cn|[[$phong#Colors|$phongalbedotint]] can now be used without [[$phong#Masking|$phongexponenttexture]].}} | |||
::{{notice:zh-cn|Will use entirety of {{ent|$basetexture}}, without being masked.}} | |||
* [[$phong#Colors|$phongwarptexture]] works. ( does not work in {{l4d2}} ).<br> | |||
* [[$phong#Colors|$phongalbedoboost]] Exists now. Used to be {{only|{{csgo}}.}} | |||
* [[$phong#Colors|$phongalbedoboost]] + {{ent|$detail}} Works. Does not work in {{csgo|4}}.<br> | |||
* {{note:zh-cn|[[$phong#Colors|$phongtint]] does no longer disable [[$phong#Colors|$phongalbedotint]]. It will do <code>($baseTexture * Mask) * $PhongTint</code> }} | |||
::{{notice:zh-cn|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>) | |||
* {{important:zh-cn|By default the original masking for the $envmap will be replicated as to not have disparity.<br> | |||
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}}. | |||
::{{notice:zh-cn|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> | |||
* [[$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|$basemapluminancephongmask]] Exists now. ( Used to be {{only|{{l4d}}+}} | |||
* [[$phong#Colors|$phongalbedoboost]] Exists now. ( Used to be {{only|{{csgo}}+}} | |||
<br> | |||
<br> | |||
<br> | |||
<br> | |||
{{todo|Add LUX_WorldVertexTransition and other LUX_ Shaders to this list of comparison and changes.}} | |||
:{{note:zh-cn| Probably better as their own pages to document all parameters.}} |
Revision as of 04:02, 20 February 2023
LUX是一个专门为
起源2013 单人分支和
起源2013 多人分支制作和开发的模组,其目的皆在为完全重写所有原版和
Mapbase的着色器
目标
- 大修\清理
materialsystem\stdshaders\
目录
- 大幅减少所有着色器的编译时间
- Template:Why:zh-cn
- 告示: 即便使用高端CPU也至少需要半天或更久的时间进行编译。以
LUX为例,在4核@4.1Hz环境下编译整个LUX_Lightmappedgeneric仅需要大约30秒
- 着色器仅使用SM 3.0
- Template:Why:zh-cn
- Template:Note:zh-cn
- Template:Note:zh-cn
- 告示: Linux和MacOS暂无官方支持。以上系统用户需要使用
togl
进行补丁才能使用SM3.0,或使用DXVK
- 完全重写.h, .cpp, .fxc文件
- 更多有关着色器、自身参数、如何工作以及任何可能的注意事项的文档
- 告示: 你可能已经注意到了如$lightwarptexture、$detail、UnlitTwoTexture、$envmapmask得到了由ShiroDkxtro2贡献的重大更新
- 他为
添加了新的注意事项和bug记录。这些文档是
LUX开发的直接结果,尽管开发的重点集中在
上,因为他们是开源项目
- Template:Note:zh-cn
- 修复大多数参数的Bug和警告
- 禁用特定功能的简单方法
- 对Mapbase的兼容性
- 告示: 要替换其他mod(如Source 2013社区版,以Mapbase为本体的mod)修改的原版着色器,应该和直接替换
stdshaders\
目录一样简单 - Template:Note:zh-cn
计划实现的功能
这是正在实施的新功能列表,或者将从较新的引擎分支移植/复刻的功能,例如
Template:Note:zh-cn
File:Important template.gif 重要:
LUX不使用任何的泄露代码。像$phongalbedoboost(仅存在于 csgo 之中)这样的功能不是什么难以实现的东西,它们可以在不使用泄露代码的情况下安全的复现

出于
Mapbase而需实现的功能
- 来自
的$phongdisablehalflambert+
- 所有“几何”用着色器的径向雾
- Spline-Ropes
- 视差修正反射贴图
- Template:Note:zh-cn
- File:Important template.gif 重要:
和
参数是一样的,所以Mapbase的地图编译器也可以使用
- VertexLitGeneric上同时使用$envmapmask 反射遮罩和$bumpmap 法线贴图的支持
- 控制器着色器"Postprocessing"的替代品
- 来自
的着色器"Engine_post"替代品
- $blendmodulatetexture的Hammer内预览修复
- 固体用$phong 漫反射
- 树叶飘动
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.
- File:Important template.gif 重要: The Lightmap does not do bumped-lighting using the bumpmap. Only named-lights/projected textures will be able to do so.
- Template:Note:zh-cn
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
- Water Shader with $flowmap Support - From
- $envmaplightscale From
for brushes
+ AND models (仅存在于
之中)+
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
待完善: Move This to their own pages or something like that.
LightMappedGeneric
Stock Shader's













Template:Note:zh-cn
Template:Note:zh-cn
Template:Note:zh-cn
Template:Note:zh-cn
Template:Note:zh-cn
Template:Note:zh-cn
Template:Note:zh-cn
Template:Note:zh-cn
告示: $basealphaenvmapmask requires inverted masks
LUX_LightMappedGeneric
- $detailblendmode 1-9 works.
- $detailblendmode 10-11 planned.
- $bumpmap + $envmapmask works, used to be (仅存在于
. 之中)
- $lightwarptexture + $detail works ( does not work in
).
- $basealphaenvmapmask + $bumpmap works.
- $selfillummask Exists now.
- $blendtintbybasealpha Exists now.
- $selfillum_envmapmask_alpha Exists now.
- $detailtexturetransform Exists now.
- 告示: Caveat - Has higher priority than $selfillum/$selfillummask.
- 告示: Caveat - $selfillumtexture has higher priority than both.
- File:Important template.gif 重要: $basealphaenvmapmask does no longer require a flipped mask.
解决方案:Materials that previously used have to be adjusted. Use $envmapmask or $normalmapalphaenvmapmask instead!
VertexLitGeneric
Stock Shader's
Always
$envmaplightscale(仅存在于 之中).
Without $Bumpmap







With $Bumpmap







Template:Note:zh-cn Template:Note:zh-cn Template:Note:zh-cn

With $Phong




















0.0f
regardless of whether $invertphongmask is used. [todo tested in ?]
Template:Note:zh-cn Template:Note:zh-cn Template:Note:zh-cn Template:Note:zh-cn
LUX_VertexLitGeneric
Without $Bumpmap
- $detailblendmode 10-11 planned. If possible.
- $selfillumfresnel Exists now.
- $lightwarptexture Exists now.
- 待完善: Make a parameter that allows its usage. Right now default behavior is replicated and a default bumpmap is bound.
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.
- Template:Note:zh-cn
- Template:Note:zh-cn
- 告示: Will use entirety of $basetexture, without being masked.
- $phongwarptexture works. ( does not work in
).
- $phongalbedoboost Exists now. Used to be (仅存在于
. 之中)
- $phongalbedoboost + $detail Works. Does not work in
反恐精英:全球攻势.
- Template:Note:zh-cn
- 告示: When no $phongexponenttexture is specified, Mask will be 1.0f!
- $envmap Can now be not-masked by using a new parameter (
$phongenvmapnomask
) - File:Important template.gif 重要: 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.
- 告示: 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 (仅存在于
+ 之中)
- $phongexponentfactor Exists now for
. ( Used to be (仅存在于
之中)
- $basemapluminancephongmask Exists now. ( Used to be (仅存在于
+ 之中)
- $phongalbedoboost Exists now. ( Used to be (仅存在于
+ 之中)
待完善: Add LUX_WorldVertexTransition and other LUX_ Shaders to this list of comparison and changes.