这篇条目有关 Source引擎。如需详情,点击这里。

Zh/Env projectedtexture: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "{{lang|Env projectedtexture}} thumb|GMOD中一个投射一个多彩的[[texture|材质的效果。]] File:Global_shadow_mapping.jpg|thumb|[[Po...")
 
 
(29 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{lang|Env projectedtexture}}
{{LanguageBar}}
[[File:Projected texture.jpg|thumb|GMOD中一个投射一个多彩的[[texture|材质]]的效果。]]
{{tabs|main=source|source=1|source2=1|env_projectedtexture}}
[[File:Global_shadow_mapping.jpg|thumb|[[Portal 2]] 将其广泛运用于世界照明。]]
[[File:Env projectedtexture appearances.jpg|thumb|Env_projectedtexture有着不同的外观]]
{{point_ent:zh|env_projectedtexture|since=Half-Life 2: Episode One}} 它投射一个[[texture|材质]]作为一个动态光源,可以影响这个世界上所有的对象。可选参见[[Wikipedia:Shadow mapping|Shadow Mapping]].
[[File:Projected texture.jpg|thumb|在[[Garry's Mod|Gmod]]中投射一个彩色[[texture|纹理]]]]
[[File:Global_shadow_mapping.jpg|thumb|[[Portal 2|传送门2]]大量使用投射纹理作为地图光照]]
[[File:volumetric_projected_texture_p2ce.jpg|thumb|{{P2CE}}在原版[[Portal 2|传送门2]]地图上的体积光效果]]
{{this is a|point entity|name=env_projectedtexture|since=Source 2006}} 它投射一个{{L|Texture|纹理}}作为一个动态光源,可以影响地图内所有的物体。还可以选择使用[[Wikipedia:Shadow mapping|阴影贴图]]。 投射纹理不像其他光照实体的光照一样是预先生成的,这种光是在游戏内实时计算的,地图本身不需要经过{{L|VRAD}}处理就可以使用。


{{code class:zh|CEnvProjectedTexture|env_projectedtexture.cpp}}
{{warning|这是起源里最吃配置的实体,谨慎使用}}


==注意事项==
{{code class:zh-cn|CEnvProjectedTexture|env_projectedtexture.cpp}}
*Valve's games only support one shadow map in the [[PVS]] at a time.
: {{fix|It is possible to modify/remove this limit by [[Env_projectedtexture/fixes#Enabling_multiple_shadow_maps.|following these instructions.]]}}
*Textures used for projected textures require the flags Clamp S, Clamp T and Clamp All to avoid glitchy tiling. Also note, that VTFs are used directly and no VMT is needed.
{{note|In [[Garry's Mod]], there can be up to 9 active <code>env_projectedtexture</code>s turned on with shadow mapping at a time. You can also increase this limit by putting <code>-numshadowtextures #</code> in the Steam launch parameters of Garry's Mod, where # is the number of shadow maps the game should allow.}}
*Shadows are only rendered when the user is running with "High" shadow detail. If your options menu does not show the "High" shadow detail setting by default, you can add <code>-force_vendor_id 0x10DE -force_device_id 0x1180</code> to the game's launch options for it to show up.
*In multiplayer, <code>mat_supportflashlight</code> must be set to 1 for flashlights to work. By default these ConVars are disabled in [[Team Fortress 2]], so this entity won't work there without special configuration.
*[[Viewmodel]]s won't receive light or shadows from projected textures. You can follow [[env_projectedtexture/fixes#Enabling shadow receiving on the view model|these instructions to fix this bug]].
{{bug|In Portal 2, some Nvidia graphics cards render white specks or squares on certain textures. To fix this, remove the bumpmap ({{ent|$bumpmap}} or {{ent|$ssbump}}) or {{ent|$detail}} textures.}}
: [https://www.youtube.com/watch?v=PJ1mnJHln5Q Video of said bug.]
{{bug|Parenting does not work with stock SDK code.}}
: {{fix|This bug is fixable by following these instructions: [[Env_projectedtexture/fixes#Fixing Parenting]].|code}}
===Source 2007/2009 bugs===
These have all been fixed in more recent engine builds.<!--Do we really still need this section? These issues are fixed now, yes?-->


{{bug|The configurable texture value from Hammer is not accepted - will always default to the flashlight. You must use the <code>SpotlightTexture</code> [[input]] or you can also override the actual contents of the default VTF with a new one.}}
==注意事项与Bug修复==
: {{fix|You can fix this issue by following these instructions: [[Env_projectedtexture/fixes#Fix_configurable_texture_value_in_Hammer]].|code}}
{{main|Env_projectedtexture/fixes}}
{{note|The <code>SpotlightTexture</code> input has been disabled in the Portal 2 and CS:GO engines, and instead shows an error message: "SetSpotlightTexture is disabled. If you need this feature reimplemented, tell a programmer."}}
{| class="standard-table"
! 问题
! 受影响的游戏
! 修复/解决方案
! 备注
|-
| 由于着色器缺失,{{strata|2}}中的体积光选项暂不可用
| {{strata|2}}
| 无
| 无
|-
| 官方起源游戏只能同时渲染一个ShadowMap
| 官方{{source|3.1}}游戏/原始{{src13|3.1|nt=0}}源代码
| 可[[Env_projectedtexture/fixes#Enabling_multiple_shadow_maps.|参照此教程]]来修改/移除此限制
| 以下游戏为特例:
*{{gmod}}: 9 (可使用启动参数{{code|-numshadowtextures #}}调整)
*{{strata}}: 8
*{{mapbase}}: 4 (可使用启动参数{{code|-numshadowtextures #}}调整)
*{{infra}}: 8
|-
| 投射的纹理需要勾选Clamp S,Clamp T和Clamp All Flags,以避免平铺时出现问题,另外请注意,可直接指定VTF而无需VMT
| 所有{{source|3.1}}游戏
| 无
| 无
|-
| 仅在阴影细节为“高”时才可渲染投射的阴影<br>
| ''除''{{portal2}}和{{csgo}}的所有游戏{{source|3.1}}
| 如果你的设置界面里阴影细节没有显示选项“高”,请在游戏启动参数里添加{{code|-force_vendor_id 0x10DE -force_device_id 0x1180}}
|
*{{bms|3.1}}有多个针对动态阴影渲染的设置选项
*{{csgo|3.1}}中,投射出的动态阴影可在阴影细节设置为“低”时渲染
|-
| 在多人游戏中,{{code|mat_supportflashlight}}必须设置为1才能使用手电筒
| 所有{{source|3.1}}多人游戏
| 无
| 默认情况下,这些指令在{{L|Team Fortress 2}}被禁用,在不进行特殊设置的情况下无法使用该实体
|-  
| {{L|Viewmodel}}不会接收来自投射纹理的光照或阴影
| ''除''{{gmod}}和{{portal2}}外的所有{{source|3.1}}游戏
| [[env_projectedtexture/fixes#Enabling shadow receiving on the view model]]
| {{ModernConfirm|{{bms}}是否修复了此问题,其中大量使用了动态阴影}}
|-
| 部分英伟达显卡(尤其是使用最新驱动程序或2010中后期以来的所有较新{{Nvidia|4}}显卡)在某些纹理上呈现大/小白色斑点、方块或噪点(有时还会闪烁)。
| {{portal2|3.1}}和{{gmod|3.1}},也可能存在于所有{{source|3.1}}游戏{{confirm}}.
| 移除({{ent|$bumpmap}},{{ent|$ssbump}})或{{ent|$detail}} textures),或使用{{code|mat_bumpmap 0}}(来禁止渲染法线贴图),或以Vulkan模式运行游戏(启动参数里添加{{code|-vulkan}}).
| [https://www.youtube.com/watch?v=PJ1mnJHln5Q 复原此问题的视频(需要翻墙).]<br>另一个在Gmod中的复原GIF(点击以查看GIF): <br>[[File:Bug-env_projectedtexture-GMOD-Nvidia.gif|120px|一个在{{gmod|4}}中复原此问题的GIF.]]
|-
| 在DirectX 9模式下运行时,无论阴影细节设置如何,某些显卡都不会正确渲染投射纹理投射出的阴影,其阴影会穿过固体和模型
| {{portal2|3.1}}
| 通过启动参数{{code|-vulkan}}来以Vulkan模式运行游戏
| 也影响所有Directx 9模式下的模组,已在{{p2ce}}和{{portalrev}}中修复
|-
| 原始代码中,实体绑定无法使用
| {{src13|3.1|nt=0}}
| [[Env_projectedtexture/fixes#Fixing Parenting]]
| 无
|-
| 投射的光照没有与{{ent|env_cascade_light}}的平滑过渡
| {{csgo|3.1|nt=1}}
| 无
| 无
|-
| {{code|SpotlightTexture}}在部分游戏中被禁用
| {{portal2branch|3.1}}和{{csgobranch|3.1|nt=1}}
| 无
| 已在{{strata|3.1}}中修复
|-
!colspan="4"|Source 2007/2009 Bugs
|-
|colspan="4"|{{note|此页面之前的结构方式很容易将新发现的错误归入错误的类别, 因此以下一些错误可能会也可能不会出现在现代标题中。}}
|-
| 不接受Hammer中的纹理键值,将始终使用手电筒纹理
| {{src07|3.1}}, {{src09|3.1}}, {{srcmp|3.1}}
| 使用{{code|SpotlightTexture}}{{L|输入}}来指定纹理
[[Env_projectedtexture/fixes#Fix_configurable_texture_value_in_Hammer]]
| 无
|-
| 此实体无法瞄准另一个实体
| {{src07|3.1}}, {{src09|3.1}}, {{srcmp|3.1}} {{confirm}}
| [[env_projectedtexture/fixes#Fixing targeting]]
| 无
|-
| {{L|Model|模型}}无法正确接收自身的阴影
| {{src07|3.1}}, {{src09|3.1}}, {{srcmp|3.1}} {{confirm}}
| 创建法线贴图,即便是平面法线也可以,例如{{file|dev/flat_normal|vtf}}.
| 无
|-
| 在{{portal|3.1}}中,如果该实体与传送门重叠会出现问题
| {{portal|3.1}}
| 无
| {{ModernConfirm|是否已在最新版的传送门中修复?}}
|}


{{bug|The entity cannot target another entity.}}
==实体属性(Flags)==
: {{fix|This bug is fixable by following these instructions: [[env_projectedtexture/fixes#Fixing targeting]].|code}}
{{fl|1|Enabled|是否默认开启.
{{bug|[[Model]]s will not receive their own shadows correctly unless using [[$bumpmap]]. Even a flat bump map is sufficient.}}
:{{bug|hidetested=1|这个属性[[since|从]]{{as|2}}才有。 在{{source 2013}}它不起作用。 <br>{{workaround}}使用{{ent|logic_auto}}进行TurnOff输入。}}
{{bug|Causes issues if the entity overlaps a portal in [[Portal|Portal 1]]. Simply the projection overlapping a portal works fine.}}
}}
{{fl|2|Always Update (for moving light)|所有灯光始终更新位置, 在{{gmod|2}}里也存在。
:{{tip|如果游戏不支持此属性, 你仍可以移动投影纹理。每0.24秒清除父对象,每0.25秒设置父对象,这将更新投影纹理位置(父对象必须有{{L|attachment|附着点}})。}}
|since={{as}}|also={{Mapbase}}。}}


==Flags==
==键值==
*1: Enabled
{{KV:zh-cn|Target (target)|targetname|跟着目标移动,确保勾选 ''Always update''。}}
*2: Always Update (moving light) {{AS add}}
{{KV:zh-cn|FOV (lightfov)|float|投射的fov范围
{{confirm|该键值似乎在Alien Swarm中没有效果}}}}
{{KV:zh-cn|NearZ (nearz)|float|比此距离近的物体不接收投射。}}
{{KV:zh-cn|FarZ (farz)|float|同上,但是比此距离远。}}
{{KV:zh-cn|Enable Shadows (enableshadows)|boolean|投射出来的阴影是否开启。. 0 {{=}} no, 1 {{=}} yes.}}
{{KV:zh-cn|Shadow Quality (shadowquality)|Choices|阴影质量
:*0: 低 (锐利的、像素化的阴影)
:*1: 高 (边缘平滑的阴影) }}
{{KV:zh-cn|Light Only Target (lightonlytarget)|boolean|只有目标才行收到效果.}}
{{KV:zh-cn|Light World (lightworld)|boolean|是否影响世界上的静态几何. 0 {{=}} no, 1 {{=}} yes.}}
{{KV:zh-cn|Light Color (lightcolor)|color255 + int|颜色与强度}}
{{KV:zh-cn|Camera Space (cameraspace)|integer|角度,对于摄像机.}}
{{KV:zh-cn|Texture Name (texturename)|string|nofgd=1|该实体投射的纹理。必须是{{L|VTF}}文件而不是{{L|VMT}},相对于<code>/materials。</code>}}
{{KV:zh-cn|Texture Frame (textureframe)|int|nofgd=1|材质帧数,如果是动态材质才行}}
{{KV:zh-cn|Simple Projection (simpleprojection)|since=AS|nofgd=1|boolean|表示这是否是一个简单的、不产生光照的投射纹理。}}
{{KV:zh-cn|Simple Projection Size (projection_size)|since=AS|nofgd=1|float|简单投射的大小|}}
{{KV:zh-cn|Simple Projection Rotation (projection_rotation)|since=AS|nofgd=1|float|简单投射的旋转角度}}
{{KV:zh-cn|Brightness Scale (brightnessscale)|float|since=AS|also=mapbase|按该亮度缩放光照颜色。由于投射纹理的亮度值只能是0到255,所以使用Brightness Scale键值可以使投影纹理比255更亮。}}
{{confirm:zh-cn|是否仅在Mapbase里需要通过该键值使用更高的亮度?}}
{{KV:zh-cn|Color Transition Time (colortransitiontime)|float|since=AS|also=mapbase|改变颜色所需的时间。值越高速度越快。}}
{{KV:zh-cn|Appearance (style)|choices|since=P2|各种自定义外观预设。{{note|需要Flags <code>Always Update</code>被勾选以使其正常工作}} }}
{{lightstyle presets}}
{{KV:zh-cn|Custom Appearance (pattern)|string|since=P2|为该光照实体设置自定义的外观模式。图案格式是一串字符,其中'''a'''是全暗,'''z'''是全亮。即<code>aaggnnttzz</code>会是一个从黑暗到光明的阶梯式淡入淡出。}}
{{KV:zh-cn|Default Appearance (defaultstyle)|string|since=P2|}}
{{KV:zh-cn|Enable Volumetrics|boolean|only={{P2CE}}|intn=volumetric|是否为该投射纹理启用体积光}}
{{KV:zh-cn|Volumetric Intensity|float|only={{P2CE}}|intn=volumetricintensity|定义体积光的强度,(默认值为1,可以使用更高的值,没有严格限制)}}
{{KV BaseEntity:zh-cn|css=1}}


==Keyvalues==
==输入==
{{KV|Target (target)|targetname|The entity will rotate to point at this target. Make sure you check the ''Always update'' flag if you set this.}}
{{note|在部分游戏的{{L|FGD}}里,只有<code>TurnOn</code>,<code>TurnOff</code>和<code>FOV</code>被写入FGD中}}
{{KV|FOV (lightfov)|float|The field of view cone/pyramid at which the texture is projected.
{{IO:zh-cn|TurnOn|开启。}}
{{IO:zh-cn|TurnOff|关闭}}
{{IO:zh-cn|FOV|param=float|设置 '''FOV'''.}}
{{IO:zh-cn|EnableShadows|param=bool|设置是否显示阴影 0 {{=}} no, 1 {{=}} yes.}}
{{IO:zh-cn|SpotlightTexture|param=string|设置射灯材质.}}
{{IO:zh-cn|Target|param=string|指定一个新的 '''目标实体''' .}}
{{IO:zh-cn|CameraSpace|param=boolean|设置 '''Camera Space'''.}}
{{IO:zh-cn|LightOnlyTarget|param=boolean|设置 '''Light Only Target'''.


{{confirm|This keyvalue does not work in Alien Swarm.}}}}
:{{bug|无效输入}}}}
{{KV|NearZ (nearz)|float|Objects closer than this will not receive the light from the projection.}}
{{IO:zh-cn|LightWorld|param=int|设置 '''Light World'''. 0 {{=}} no, 1 {{=}} yes.}}
{{KV|FarZ (farz)|float|Objects beyond this distance will not receive the light from the projection.}}
{{IO:zh-cn|AlwaysUpdateOn|since=AS|开启每帧更新(用于移动光源)。}}
{{KV|Enable Shadows (enableshadows)|boolean|Enables/disables shadows from this projected texture. 0 {{=}} no, 1 {{=}} yes.}}
{{IO:zh-cn|AlwaysUpdateOff|since=AS|关闭每帧更新(用于移动光源)。}}
{{KV|Shadow Quality (shadowquality)|Choices|Quality of shadows.
{{IO:zh-cn|LightColor|since=AS|param=color255|设置'''光照颜色'''.}}
:*0: Low (sharp, pixelized shadows)
{{IO:zh-cn|SetLightStyle|param=integer|since=P2|为该实体设置一个'''外观'''。(详见上方键值章节的“Appearance”部分)}}
:*1: High (smooth edged shadows)}}
{{IO:zh-cn|SetPattern|设置'''自定义外观'''。(详见上方键值章节的“Custom Appearance”部分)|param=string|since=P2}}
{{KV|Light Only Target (lightonlytarget)|boolean|Limit flashlight effect to only affect target entity.}}
{{IO:zh-cn|SetNearZ|设置 '''NearZ'''.|param=float|since=P2}}
{{KV|Light World (lightworld)|boolean|Control whether flashlight affects static world geometry. 0 {{=}} no, 1 {{=}} yes.}}
{{IO:zh-cn|SetFarZ|设置 '''FarZ'''.|param=float|since=P2}}
{{KV|Light Color (lightcolor)|color255 + int|RGB light color and intensity}}
{{IO:zh-cn|SetVolumetricIntensity|param=float|设置体积光的强度。(默认值为1,可以使用更高的值,没有严格限制)|only={{P2CE}}}}
{{KV|Camera Space (cameraspace)|integer|Angles are interpreted as being relative to camera.}}
{{IO:zh-cn|SetBrightnessScale|param=float|设置光照强度|only={{P2CE}}}}
{{KV|Texture Name (texturename)|string|nofgd=1|The [[texture]] or [[material]] which this entity projects. Must be a [[VTF]] file (not VMT), relative to <code>/materials</code>.}}
{{I BaseEntity:zh-cn}}
{{KV|Texture Frame (textureframe)|int|nofgd=1|If the texture is animated, this is the frame it should begin on.}}
{{KV|Simple Projection (simpleprojection)|since=AS|nofgd=1|boolean|Indicates if this is a simple, non-light casting texture projection.}}
{{KV|Simple Projection Size (projection_size)|since=AS|nofgd=1|float|}}
{{KV|Simple Projection Rotation (projection_rotation)|since=AS|nofgd=1|float|}}
{{KV|Brightness Scale (brightnessscale)|float|since=AS|Scale the light color by this brightness.}}
{{KV|Color Transition Time (colortransitiontime)|float|since=AS|Amount of time it takes for a color change to occur. Higher numbers cause faster transitions.}}
{{KV|Appearance (style)|choices|since=P2|Various Custom Appearance presets. {{Note|Requires AlwaysUpdateOn to work. }} }}
{{light appearances}}
{{KV|Custom Appearance (pattern)|string|since=P2|Set a custom pattern of light brightness for this light. Pattern format is a string of characters, where '''a''' is total darkness, '''z''' fully bright. i.e. <code>aaggnnttzz</code> would be a steppy fade in from dark to light.}}
{{KV|Default Appearance (defaultstyle)|string|since=P2|}}
{{KV BaseEntity|css=1}}


==Inputs==
==输出==
{{note|In some [[FGD]]s, only <code>TurnOn</code>, <code>TurnOff</code> and <code>FOV</code> are present.}}
{{O BaseEntity:zh-cn|l4d=1}}
{{IO|TurnOn|Turns on the texture.}}
{{IO|TurnOff|Turns off the texture.}}
{{IO|FOV|param=float|Sets '''FOV'''.}}
{{IO|EnableShadows|param=bool|Set the if shadows are enabled. 0 {{=}} no, 1 {{=}} yes.}}
{{IO|SpotlightTexture|param=string|Sets the spotlight texture.}}
{{IO|Target|param=string|Specify a new '''Target''' entity to point at.}}
{{IO|CameraSpace|param=boolean|Sets '''Camera Space'''.}}
{{IO|LightOnlyTarget|param=boolean|Sets '''Light Only Target'''.


:{{bug|Non-functional.}}}}
{{ACategory|Lighting}}
{{IO|LightWorld|param=int|Sets '''Light World'''. 0 {{=}} no, 1 {{=}} yes.}}
{{IO|AlwaysUpdateOn|since=AS|Turn on per frame updating (for moving lights).}}
{{IO|AlwaysUpdateOff|since=AS|Turn off per frame updating (for moving lights).}}
{{IO|LightColor|since=AS|param=color255|Change the '''Light Color'''.}}
{{IO|SetLightStyle|param=integer|since=P2|Sets an '''Appearance'''. (see Appearance keyvalue above for possible values)}}
{{IO|SetPattern|Sets '''Custom Appearance'''. (see Custom Appearance keyvalue above)|param=string|since=P2}}
{{IO|SetNearZ|Sets '''NearZ'''.|param=float|since=P2}}
{{IO|SetFarZ|Sets '''FarZ'''.|param=float|since=P2}}
{{I BaseEntity}}
 
==Outputs==
{{O BaseEntity|l4d=1}}
 
[[Category:Lighting]]

Latest revision as of 07:15, 25 June 2025

English (en)中文 (zh)Translate (Translate)
Env_projectedtexture有着不同的外观
Gmod中投射一个彩色纹理
传送门2大量使用投射纹理作为地图光照
传送门 2:社区特供版在原版传送门2地图上的体积光效果

env_projectedtexture是一个点实体(en),可在所有的 起源 起源 游戏,自从 起源2006 起源2006 以来中使用。 它投射一个纹理(en)作为一个动态光源,可以影响地图内所有的物体。还可以选择使用阴影贴图。 投射纹理不像其他光照实体的光照一样是预先生成的,这种光是在游戏内实时计算的,地图本身不需要经过VRAD(en)处理就可以使用。

Warning.png警告:这是起源里最吃配置的实体,谨慎使用


待完善: This template is currently using deprecated suf or {{Lang}}-based translations. Please use the main {{Code class}} instead, which uses {{Autolang}}.

在源代码中,它由 class CEnvProjectedTexture 代表,定义于 env_projectedtexture.cpp


注意事项与Bug修复

问题 受影响的游戏 修复/解决方案 备注
由于着色器缺失,地层起源 地层起源中的体积光选项暂不可用 地层起源 地层起源
官方起源游戏只能同时渲染一个ShadowMap 官方起源游戏/原始Source SDK Base 2013源代码 参照此教程来修改/移除此限制 以下游戏为特例:
  • Garry's Mod: 9 (可使用启动参数-numshadowtextures #调整)
  • 地层起源: 8
  • Mapbase: 4 (可使用启动参数-numshadowtextures #调整)
  • 基建危机: 8
投射的纹理需要勾选Clamp S,Clamp T和Clamp All Flags,以避免平铺时出现问题,另外请注意,可直接指定VTF而无需VMT 所有起源游戏
仅在阴影细节为“高”时才可渲染投射的阴影
传送门2反恐精英:全球攻势的所有游戏起源 如果你的设置界面里阴影细节没有显示选项“高”,请在游戏启动参数里添加-force_vendor_id 0x10DE -force_device_id 0x1180
在多人游戏中,mat_supportflashlight必须设置为1才能使用手电筒 所有起源多人游戏 默认情况下,这些指令在Team Fortress 2(en)被禁用,在不进行特殊设置的情况下无法使用该实体
Viewmodel(en)不会接收来自投射纹理的光照或阴影 Garry's Mod传送门2外的所有起源游戏 env_projectedtexture/fixes#Enabling shadow receiving on the view model
证实:黑山是否修复了此问题,其中大量使用了动态阴影
部分英伟达显卡(尤其是使用最新驱动程序或2010中后期以来的所有较新Nvidia Nvidia显卡)在某些纹理上呈现大/小白色斑点、方块或噪点(有时还会闪烁)。 传送门2Garry's Mod,也可能存在于所有起源游戏[证实]. 移除($bumpmap$ssbump)或$detail textures),或使用mat_bumpmap 0(来禁止渲染法线贴图),或以Vulkan模式运行游戏(启动参数里添加-vulkan). 复原此问题的视频(需要翻墙).
另一个在Gmod中的复原GIF(点击以查看GIF):
一个在 Garry's Mod中复原此问题的GIF.
在DirectX 9模式下运行时,无论阴影细节设置如何,某些显卡都不会正确渲染投射纹理投射出的阴影,其阴影会穿过固体和模型 传送门2 通过启动参数-vulkan来以Vulkan模式运行游戏 也影响所有Directx 9模式下的模组,已在传送门 2:社区特供版Portal: Revolution中修复
原始代码中,实体绑定无法使用 Source SDK Base 2013 Env_projectedtexture/fixes#Fixing Parenting
投射的光照没有与env_cascade_light的平滑过渡 CS:GO
SpotlightTexture在部分游戏中被禁用 传送门 2 引擎分支CS:GO 引擎分支 已在地层起源中修复
Source 2007/2009 Bugs
Note.png注意:此页面之前的结构方式很容易将新发现的错误归入错误的类别, 因此以下一些错误可能会也可能不会出现在现代标题中。
不接受Hammer中的纹理键值,将始终使用手电筒纹理 起源2007, 起源2009, 起源 多人分支 使用SpotlightTexture输入(en)来指定纹理

Env_projectedtexture/fixes#Fix_configurable_texture_value_in_Hammer

此实体无法瞄准另一个实体 起源2007, 起源2009, 起源 多人分支 [证实] env_projectedtexture/fixes#Fixing targeting
模型(en)无法正确接收自身的阴影 起源2007, 起源2009, 起源 多人分支 [证实] 创建法线贴图,即便是平面法线也可以,例如🖿dev/flat_normal.vtf.
传送门中,如果该实体与传送门重叠会出现问题 传送门
证实:是否已在最新版的传送门中修复?

实体属性(Flags)

Enabled : [1]
是否默认开启.
Icon-Bug.png错误:这个属性异形丛生 异形丛生才有。 在起源2013它不起作用。
PlacementTip.png解决方案:使用logic_auto进行TurnOff输入。
Always Update (for moving light) : [2] (存在于自 异形丛生 以来) (也存在于 Mapbase。 之中)
所有灯光始终更新位置, 在Garry's Mod Garry's Mod里也存在。
Tip.png提示:如果游戏不支持此属性, 你仍可以移动投影纹理。每0.24秒清除父对象,每0.25秒设置父对象,这将更新投影纹理位置(父对象必须有附着点(en))。

键值

Target (target) <目标名(en)>
跟着目标移动,确保勾选 Always update
FOV (lightfov) <浮点型(en)>
投射的fov范围
证实:该键值似乎在Alien Swarm中没有效果
NearZ (nearz) <浮点型(en)>
比此距离近的物体不接收投射。
FarZ (farz) <浮点型(en)>
同上,但是比此距离远。
Enable Shadows (enableshadows) <布尔值(en)>
投射出来的阴影是否开启。. 0 = no, 1 = yes.
Shadow Quality (shadowquality) <Choices(en)>
阴影质量
  • 0: 低 (锐利的、像素化的阴影)
  • 1: 高 (边缘平滑的阴影)
Light Only Target (lightonlytarget) <布尔值(en)>
只有目标才行收到效果.
Light World (lightworld) <布尔值(en)>
是否影响世界上的静态几何. 0 = no, 1 = yes.
Light Color (lightcolor) <color255(en) + 整数(en)>
颜色与强度
Camera Space (cameraspace) <整数(en)>
角度,对于摄像机.
Texture Name (texturename) <字符串(en)> 不存在于FGD!
该实体投射的纹理。必须是VTF(en)文件而不是VMT(en),相对于/materials。
Texture Frame (textureframe) <整数(en)> 不存在于FGD!
材质帧数,如果是动态材质才行
Simple Projection (simpleprojection) <布尔值(en)> (存在于自 AS 以来) 不存在于FGD!
表示这是否是一个简单的、不产生光照的投射纹理。
Simple Projection Size (projection_size) <浮点型(en)> (存在于自 AS 以来) 不存在于FGD!
简单投射的大小
Simple Projection Rotation (projection_rotation) <浮点型(en)> (存在于自 AS 以来) 不存在于FGD!
简单投射的旋转角度
Brightness Scale (brightnessscale) <浮点型(en)> (存在于自 AS 以来) Template:Also:zh-cn
按该亮度缩放光照颜色。由于投射纹理的亮度值只能是0到255,所以使用Brightness Scale键值可以使投影纹理比255更亮。
证实:是否仅在Mapbase里需要通过该键值使用更高的亮度?
Color Transition Time (colortransitiontime) <浮点型(en)> (存在于自 AS 以来) Template:Also:zh-cn
改变颜色所需的时间。值越高速度越快。
Appearance (style) <choices> (存在于自 传送门2 以来)
各种自定义外观预设。
Note.png注意:需要Flags Always Update被勾选以使其正常工作
Lightstyle presets (epilepsy warning)
Literal Value Description Sequence Preview
0 Normal m Lightstyle 0.png
10 Fluorescent flicker mmamammmmammamamaaamammma Lightstyle 10.gif
2 Slow, strong pulse abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba Lightstyle 2.gif
11 Slow pulse, noblack abcdefghijklmnopqrrqponmlkjihgfedcba Lightstyle 11.gif
5 Gentle pulse jklmnopqrstuvwxyzyxwvutsrqponmlkj Lightstyle 5.gif
1 Flicker A mmnmmommommnonmmonqnmmo Lightstyle 1.gif
6 Flicker B nmonqnmomnmomomno Lightstyle 6.gif
3 Candle A mmmmmaaaaammmmmaaaaaabcdefgabcdefg Lightstyle 3.gif
7 Candle B mmmaaaabcdefgmmmmaaaammmaamm Lightstyle 7.gif
8 Candle C mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa Lightstyle 8.gif
4 Fast strobe mamamamamama Lightstyle 4.gif
9 Slow strobe aaaaaaaazzzzzzzz Lightstyle 9.gif
12 Underwater light mutation mmnnmmnnnmmnn Lightstyle 12.gif
Custom Appearance (pattern) <字符串(en)> (存在于自 传送门2 以来)
为该光照实体设置自定义的外观模式。图案格式是一串字符,其中a是全暗,z是全亮。即aaggnnttzz会是一个从黑暗到光明的阶梯式淡入淡出。
Default Appearance (defaultstyle) <字符串(en)> (存在于自 传送门2 以来)
Enable Volumetrics (volumetric) <布尔值(en)> (仅存在于 传送门 2:社区特供版 中)
是否为该投射纹理启用体积光
Volumetric Intensity (volumetricintensity) <浮点型(en)> (仅存在于 传送门 2:社区特供版 中)
定义体积光的强度,(默认值为1,可以使用更高的值,没有严格限制)

Template:KV BaseEntity:zh-cn

输入

Note.png注意:在部分游戏的FGD(en)里,只有TurnOnTurnOffFOV被写入FGD中
TurnOn
开启。
TurnOff
关闭
FOV <浮点型(en)>
设置 FOV.
EnableShadows <布尔值(en)>
设置是否显示阴影 0 = no, 1 = yes.
SpotlightTexture <字符串(en)>
设置射灯材质.
Target <字符串(en)>
指定一个新的 目标实体 .
CameraSpace <布尔值(en)>
设置 Camera Space.
LightOnlyTarget <布尔值(en)>
设置 Light Only Target.
Icon-Bug.png错误:无效输入  [todo tested in ?]
LightWorld <整数(en)>
设置 Light World. 0 = no, 1 = yes.
AlwaysUpdateOn  (存在于自 异形丛生 以来)
开启每帧更新(用于移动光源)。
AlwaysUpdateOff  (存在于自 异形丛生 以来)
关闭每帧更新(用于移动光源)。
LightColor <color255(en)> (存在于自 异形丛生 以来)
设置光照颜色.
SetLightStyle <整数(en)> (存在于自 传送门2 以来)
为该实体设置一个外观。(详见上方键值章节的“Appearance”部分)
SetPattern <字符串(en)> (存在于自 传送门2 以来)
设置自定义外观。(详见上方键值章节的“Custom Appearance”部分)
SetNearZ <浮点型(en)> (存在于自 传送门2 以来)
设置 NearZ.
SetFarZ <浮点型(en)> (存在于自 传送门2 以来)
设置 FarZ.
SetVolumetricIntensity <浮点型(en)> (存在于 传送门 2:社区特供版 之中)
设置体积光的强度。(默认值为1,可以使用更高的值,没有严格限制)
SetBrightnessScale <浮点型(en)> (存在于 传送门 2:社区特供版 之中)
设置光照强度
Base:
AddContext <字符串(en)>
添加到实体的 Response Contexts/响应上下文列表。格式是<key>:<value>
AddOutput <字符串(en)>
在此实体上分配新的键值/输出。对于键值,有些依赖于额外的必要代码来运行,如果它只是通过这个输入改变就行不通。必须遵循严格的格式:
语法:

ClearContext
从此实体的列表中删除所有上下文。
ClearParent
从移动层次结构中删除该实体,使其可以自由移动。
FireUser1 to FireUser4
触发相应的OnUser输出;详见 User Inputs and OutputsEnglish
Kill
从这个世界中删除此实体。
KillHierarchy
功能类似Kill,尽管此实体与其父实体都被删除了,但比Kill快一点。
RemoveContext
从实体列表删除一个上下文。名字应与现有上下文进行匹配。
SetParent <字符串(en)>
跟随此实体移动,详见 实体层级(依赖关系)
SetParentAttachment <字符串(en)>
更改此实体到其父级上的特定附属English点。实体将传送,以至于其骨骼方位English与附属匹配。在使用此输入前必须设置好实体的父实体。
SetParentAttachmentMaintainOffset <字符串(en)>
同上,但没有传送。在接收到输入时,实体保持其相对于附件的位置。
Use  不存在于FGD!
与调用 +use 的玩家相同[玩家按 +use(使用,默认E按钮)];大多数情况下没有影响。
DispatchResponse <字符串(en)> 不存在于FGD!
向实体发送一个上下文。 详见 ResponseEnglishConceptEnglish.
DispatchEffect <字符串(en)> (被移除求生之路 以来) 不存在于FGD!
在实体的原点坐标设置一个特定效果;参见 List of Client EffectsEnglish。自从求生之路 求生之路后由粒子系统取代。
RunScriptFile <脚本(en)> (存在于自 求生之路2 以来)
从硬盘执行一个 VScript 脚本文件,不带文件后缀名。会合并接收实体的脚本域。
RunScriptCode <字符串(en)> (存在于自 求生之路2 以来)
在接收输入的实体范围内执行一串 VScript 源代码。通过控制台触发时可能需要字符串引用。
Icon-Bug.png错误:在 Hammer 中,使用带有字符串的参数会破坏 VMFEnglish 文件的结构,使下一个 Hammer 会话无法查看该文件。  [todo tested in ?]
Note.png修复:使用文本编辑器手动删除带有字符串的参数。
CallScriptFunction <字符串(en)> (存在于自 求生之路2 以来) 不存在于FGD!
在接受实体脚本域上执行一段 VScript 函数。
SetLocalOrigin <coordinates(en)> (存在于自 异形丛生 以来) 不存在于FGD!
将此实体设置到地图中的某个位置。如果此实体是某实体父级,那么它的子级也会随着移动。
SetLocalAngles <angles(en)> (存在于自 异形丛生 以来) 不存在于FGD!
设置该实体的角度。

输出

Base/基础:

OnUser1 to OnUser4
这些输出将分别响应于 FireUser1FireUser4 输入。 详见 User Inputs and Outputs
OnKilled  (存在于 求生之路系列求生之路系列 之中)
当实体被Kill输入时响应此输出。