Zh/LUX: Difference between revisions

From Valve Developer Community
< 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>目录'''
:{{modernwarning:zh-cn|除了现有的着色器编译功能外,几乎所有的东西都被“扬了”。}}
:{{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}}着色器原有的功能}}
::{{modernnote:zh-cn|SDK着色器会自动回退到对应的{{LUX|2}}版本,这样使用{{Mapbase|4}}的模组无需太多改动就可以使用LUX}}
::{{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及以下有太多限制。缺少可用的常量寄存器会导致极端分支和大量“组合”。使代码变成一坨难以阅读和理解的屎山。这会抑制模组制作者的积极性。}}
:{{modernnote: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于2004年发布,[https://cdn.cloudflare.steamstatic.com/apps/valve/2010/siggraph2010_vlachos_waterflow.pdf V社在2008年考虑到了ps2.0及以下的低端硬件]。详见幻灯片第8页}}
:{{modernnote:zh-cn|这意味着不支持SM3.0的低端硬件将无法使用新的着色器}}
:{{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}}上,因为他们是开源项目}}
:{{modernnote:zh-cn|目前缺少有关着色器如何在起源中工作的文档,这导致起源的图形学领域门槛很高,需要有大量的相关经验,阻碍了模组制作者们修改着色器和创作自己的}}
:{{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,出于通俗目的进行修改-->
:{{modernnote:zh-cn|已制作一个自定义的预处理程序,可以通过禁用不需要的功能来使着色器编译的更快}}
:{{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>目录一样简单}}
:{{modernnote:zh-cn| 以上假定除修改的原版着色器外无其他的自定义着色器,但如果确实有,开发者应该能将它们添加回来,因为这是添加自定义着色器的先决条件}}
:{{note:zh-cn| 以上假定除修改的原版着色器外无其他的自定义着色器,但如果确实有,开发者应该能将它们添加回来,因为这是添加自定义着色器的先决条件}}


==计划实现的功能==
==计划实现的功能==
这是正在实施的新功能列表,或者将从较新的引擎分支移植/复刻的功能,例如{{as}}{{l4d2}}{{csgo}}
这是正在实施的新功能列表,或者将从较新的引擎分支移植/复刻的功能,例如{{as}}{{l4d2}}{{csgo}}
{{modernnote:zh-cn|该语境下的被移植“对象”通常指{{as|4}}{{mapbase|4}},但在多数情况下,其代码会出于简化或大修的目的而进行大量修改}}
{{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}}这样的功能不是什么难以实现的东西,它们可以在不使用泄露代码的情况下安全的复现}}
:{{modernwarning:zh-cn|对于更复杂的功能,与V社的实现方法相比可能存在视觉差异。}}
:{{warning:zh-cn|对于更复杂的功能,与V社的实现方法相比可能存在视觉差异。}}


====出于{{mapbase|4}}而需实现的功能====
====出于{{mapbase|4}}而需实现的功能====
Line 54: Line 54:
* Spline-Ropes
* Spline-Ropes
* [[Parallax Corrected Cubemaps|视差修正反射贴图]]
* [[Parallax Corrected Cubemaps|视差修正反射贴图]]
:{{modernnote:zh-cn|就像{{mapbase|4}}一样,视差反射需要自定义的地图编译器}}
:{{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

English (en)中文 (zh)Translate (Translate)
Zh/LUX
Development.pngAlpha 开发阶段中
Wiki
类型模组
开发商ShiroDkxtro2
引擎起源 起源
平台(存在于 PC 之中)
基于起源2013 起源2013
 
GitHub
Join Discord server

LUX LUX是一个专门为起源2013 单人分支 起源2013 单人分支起源2013 多人分支 起源2013 多人分支制作和开发的模组,其目的皆在为完全重写所有原版和Mapbase Mapbase的着色器

目标

  • 大修\清理materialsystem\stdshaders\目录
Template:Warning:zh-cn
告示: 实现LUX LUX的着色器需要将stdshaders/替换为LUX LUX自己的,这“有效”的扬了所有原版着色器的修改版,LUX应该能够实现所有起源2013Mapbase着色器原有的功能
Template:Note:zh-cn
  • 大幅减少所有着色器的编译时间
Template:Why:zh-cn
告示: 即便使用高端CPU也至少需要半天或更久的时间进行编译。以LUX 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$detailUnlitTwoTexture$envmapmask得到了由ShiroDkxtro2贡献的重大更新
他为军团要塞2异形丛生起源2013反恐精英:全球攻势添加了新的注意事项和bug记录。这些文档是LUX LUX开发的直接结果,尽管开发的重点集中在起源2013异形丛生上,因为他们是开源项目
Template:Note:zh-cn
  • 实现起源2013没有的内容
Template:Seealso:zh-cn
  • 修复大多数参数的Bug和警告
Template:Seealso:zh-cn
  • 禁用特定功能的简单方法
Template:Note:zh-cn
  • 对Mapbase的兼容性
告示: 要替换其他mod(如Source 2013社区版,以Mapbase为本体的mod)修改的原版着色器,应该和直接替换stdshaders\目录一样简单
Template:Note:zh-cn

计划实现的功能

这是正在实施的新功能列表,或者将从较新的引擎分支移植/复刻的功能,例如异形丛生求生之路2反恐精英:全球攻势 Template:Note:zh-cn

File:Important template.gif 重要: LUX LUX不使用任何的泄露代码。像$phongalbedoboost(存在于 csgo 之中)这样的功能不是什么难以实现的东西,它们可以在不使用泄露代码的情况下安全的复现
Template:Warning:zh-cn

出于Mapbase Mapbase而需实现的功能

Template:Note:zh-cn
File:Important template.gif 重要: LUXMapbase参数是一样的,所以Mapbase的地图编译器也可以使用
待完善: 这真的是移植自异形丛生Mapbase功能吗

New Features

  • In 起源2013 多人分支 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
  • In 起源2013 多人分支 Models can utilize Lightmap UV's.
Template:Warning:zh-cn
待完善: Investigate 起源2007 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

Template:Note:zh-cn
Template:Note:zh-cn
Template:Seealso:zh-cn
[File:Important template.gif 重要]
* On brushes this will use the Lightmap
* On models with $bumpmap, this will use bumped lighting.
* On models without $bumpmap, this will use Vertex Lighting.
* In 起源2013 多人分支 Models utilizing Model Lightmapping, will use the Lightmap. Regardless of whether or not $bumpmap is used.

Features that are being discarded

  • $envmapsphere and related - These features have been removed since 异形丛生 and are obsolete.
Template:Note:zh-cn

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



Stock Shaders VS LUX

待完善: Move This to their own pages or something like that.

LightMappedGeneric

Stock Shader's

Icon-Bug.png错误:$detailblendmode起源2013军团要塞2 2-9 Don't work.  [todo tested in ?]
Icon-Bug.png错误:$detailblendmode异形丛生 6 Doesn't work.  [todo tested in ?]
Icon-Bug.png错误:$detailblendmode反恐精英:全球攻势 1-6, 8 Don't work. 9 Does not work with $bumpmap, $envmap or $selfillum  [todo tested in ?]


Icon-Bug.png错误:$bumpmap + $envmapmask Doesn't work, except in 反恐精英:全球攻势 反恐精英:全球攻势  [todo tested in ?]
Icon-Bug.png错误:$lightwarptexture + $detail军团要塞2异形丛生 Doesn't work  [todo tested in ?]
Icon-Bug.png错误:$basealphaenvmapmask + bumpmap Doesn't work  [todo tested in ?]


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

告示: 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.
PlacementTip.png解决方案:Materials that previously used have to be adjusted. Use $envmapmask or $normalmapalphaenvmapmask instead!

VertexLitGeneric

Stock Shader's

Always

$envmaplightscale(存在于 反恐精英:全球攻势 之中).

Without $Bumpmap

Icon-Bug.png错误:$detailblendmode起源2013军团要塞2异形丛生反恐精英:全球攻势 10-11 Don't work.  [todo tested in ?]
Icon-Bug.png错误:$selfillumfresnel missing.  [todo tested in ?]
Icon-Bug.png错误:$lightwarptexture missing.  [todo tested in ?]
Template:Note:zh-cn

With $Bumpmap

Icon-Bug.png错误:$detailblendmode起源2013军团要塞2异形丛生反恐精英:全球攻势 5-11 Don't work.  [todo tested in ?]
Icon-Bug.png错误:$detailblendmode反恐精英:全球攻势 5-6 & 8-11 Don't work.  [todo tested in ?]

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

Icon-Bug.png错误:$selfillumfresnel disables $normalmapalphaenvmapmask.
待完善: Also on other branches than 异形丛生?
  [todo tested in ?]

With $Phong

Icon-Bug.png错误:$detailblendmode起源2013军团要塞2异形丛生反恐精英:全球攻势 8-11 Don't work.  [todo tested in ?]
Icon-Bug.png错误:$invertphongmask异形丛生起源2013 In the shadercode, only flips the mask used for $envmap.
证实:Also on newer branches?
  [todo tested in ?]
Icon-Bug.png错误:$phongalbedotint cannot be used without $phongexponenttexture.  [todo tested in ?]
Icon-Bug.png错误:$phongwarptexture求生之路2 does not work.  [todo tested in ?]
Icon-Bug.png错误:$phongalbedoboost(存在于 反恐精英:全球攻势 之中) + $detail does not work.  [todo tested in ?]
Icon-Bug.png错误:$phongtint disables $phongalbedotint.  [todo tested in ?]
Icon-Bug.png错误:$envmap always masked by something.  [todo tested in ?]
Icon-Bug.png错误:Only in 求生之路+ $envmap masked by $basetexture luminance when $normalmapalphaenvmapmask and $basemapluminancephongmask is used.  [todo tested in ?]
Icon-Bug.png错误:$envmap masked by $basetexture alpha when $normalmapalphaenvmapmask and $basemapalphaphongmask is used.  [todo tested in ?]
Icon-Bug.png错误:$basemapalphaphongmask makes $phong ignore the $bumpmap.  [todo tested in ?]
Icon-Bug.png错误:$selfillumfresnel + $normalmapalphaenvmapmask will cause the $envmap to be multiplied by 0.0f regardless of whether $invertphongmask is used.  [todo tested in ?]
Icon-Bug.png错误:$selfillumfresnel will cause $envmap to be masked using the $basetexture alpha channel  [todo tested in ?]

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

LUX_VertexLitGeneric

Without $Bumpmap

待完善: Make a parameter that allows its usage. Right now default behavior is replicated and a default bumpmap is bound.

With $Bumpmap

With $Phong

告示: Will use entirety of $basetexture, without being masked.
告示: 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

告示: This will make materials that previously used this intentionally, look different.





待完善: Add LUX_WorldVertexTransition and other LUX_ Shaders to this list of comparison and changes.
Template:Note:zh-cn