Zh/Env projectedtexture: Difference between revisions
< Zh
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 24: | Line 24: | ||
* {{note|在{{csgo}}里,<code>env_projectedtexture</code>产生的阴影在阴影质量设置为“低”时显示}} | * {{note|在{{csgo}}里,<code>env_projectedtexture</code>产生的阴影在阴影质量设置为“低”时显示}} | ||
*在多人游戏里,<code>mat_supportflashlight</code>必须被设置为1才能让手电筒正常工作,在[[Team Fortress 2|TF2]]中,这个[[Cvar|指令]]默认被禁用,故没有特殊修改的话,该实体无法在TF2中使用 | *在多人游戏里,<code>mat_supportflashlight</code>必须被设置为1才能让手电筒正常工作,在[[Team Fortress 2|TF2]]中,这个[[Cvar|指令]]默认被禁用,故没有特殊修改的话,该实体无法在TF2中使用 | ||
*[[Viewmodel|手臂模型]]不会接收来自投射纹理的任何光照和阴影,除了[[Garry's | *[[Viewmodel|手臂模型]]不会接收来自投射纹理的任何光照和阴影,除了[[Garry's Mod|Gmod]]和[[Portal 2|传送门2]]。您可以[[env_projectedtexture/fixes#Enabling shadow receiving on the view model|按照该教程]]修复这个Bug。 | ||
{{bug|在传送门2中,部分英伟达显卡会在某些纹理上呈现白色噪点或方块(老黄出来挨打)。要解决此问题,请移除该纹理的[[Bumpmap|法线贴图]]($bumpmap或$ssbump)或[[$detail|细节纹理]]}} | {{bug|在传送门2中,部分英伟达显卡会在某些纹理上呈现白色噪点或方块(老黄出来挨打)。要解决此问题,请移除该纹理的[[Bumpmap|法线贴图]]($bumpmap或$ssbump)或[[$detail|细节纹理]]}} | ||
: [https://www.youtube.com/watch?v=PJ1mnJHln5Q 描述此bug的视频] | : [https://www.youtube.com/watch?v=PJ1mnJHln5Q 描述此bug的视频] | ||
Line 40: | Line 40: | ||
{{KV:zh-cn|Target (target)|targetname|跟着目标移动,确保勾选 ''Always update''。}} | {{KV:zh-cn|Target (target)|targetname|跟着目标移动,确保勾选 ''Always update''。}} | ||
{{KV:zh-cn|FOV (lightfov)|float|投射的fov范围 | {{KV:zh-cn|FOV (lightfov)|float|投射的fov范围 | ||
{{confirm|该键值似乎在Alien Swarm中没有效果}}}} | |||
{{confirm| | |||
{{KV:zh-cn|NearZ (nearz)|float|比此距离近的物体不接收投射。}} | {{KV:zh-cn|NearZ (nearz)|float|比此距离近的物体不接收投射。}} | ||
{{KV:zh-cn|FarZ (farz)|float|同上,但是比此距离远。}} | {{KV:zh-cn|FarZ (farz)|float|同上,但是比此距离远。}} | ||
{{KV:zh-cn|Enable Shadows (enableshadows)|boolean|投射出来的阴影是否开启。. 0 {{=}} no, 1 {{=}} yes.}} | {{KV:zh-cn|Enable Shadows (enableshadows)|boolean|投射出来的阴影是否开启。. 0 {{=}} no, 1 {{=}} yes.}} | ||
{{KV:zh-cn|Shadow Quality (shadowquality)|Choices|阴影质量 | {{KV:zh-cn|Shadow Quality (shadowquality)|Choices|阴影质量 | ||
:*0: | :*0: 低 (锐利的、像素化的阴影) | ||
:*1: | :*1: 高 (边缘平滑的阴影) }} | ||
{{KV:zh-cn|Light Only Target (lightonlytarget)|boolean|只有目标才行收到效果.}} | {{KV:zh-cn|Light Only Target (lightonlytarget)|boolean|只有目标才行收到效果.}} | ||
{{KV:zh-cn|Light World (lightworld)|boolean|是否影响世界上的静态几何. 0 {{=}} no, 1 {{=}} yes.}} | {{KV:zh-cn|Light World (lightworld)|boolean|是否影响世界上的静态几何. 0 {{=}} no, 1 {{=}} yes.}} | ||
Line 54: | Line 53: | ||
{{KV:zh-cn|Texture Name (texturename)|string|nofgd=1|该实体投射的纹理。必须是[[VTF]]文件而不是[[VMT]],相对于<code>/materials。</code>}} | {{KV:zh-cn|Texture Name (texturename)|string|nofgd=1|该实体投射的纹理。必须是[[VTF]]文件而不是[[VMT]],相对于<code>/materials。</code>}} | ||
{{KV:zh-cn|Texture Frame (textureframe)|int|nofgd=1|材质帧数,如果是动态材质才行}} | {{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 (simpleprojection)|since=AS|nofgd=1|boolean|表示这是否是一个简单的、不产生光照的投射纹理。}} | ||
{{KV:zh-cn|Simple Projection Size (projection_size)|since=AS|nofgd=1|float|}} | {{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|Simple Projection Rotation (projection_rotation)|since=AS|nofgd=1|float|简单投射的旋转角度}} | ||
{{KV:zh-cn|Brightness Scale (brightnessscale)|float|since=AS|also=mapbase| | {{KV:zh-cn|Brightness Scale (brightnessscale)|float|since=AS|also=mapbase|按该亮度缩放光照颜色。由于投射纹理的亮度值只能是0到255,所以使用Brightness Scale键值可以使投影纹理比255更亮。}} | ||
{{KV:zh-cn|Color Transition Time (colortransitiontime)|float|since=AS|also=mapbase| | {{confirm:zh-cn|是否仅在Mapbase里需要通过该键值使用更高的亮度?}} | ||
{{KV:zh-cn|Appearance (style)|choices|since=P2| | {{KV:zh-cn|Color Transition Time (colortransitiontime)|float|since=AS|also=mapbase|改变颜色所需的时间。值越高速度越快。}} | ||
{{KV:zh-cn|Appearance (style)|choices|since=P2|各种自定义外观预设。{{Note:zh-cn|需要Flags <code>Always Update</code>被勾选以使其正常工作}} }} | |||
{{light appearances}} | {{light appearances}} | ||
{{KV:zh-cn|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:zh-cn|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.}} |
Revision as of 18:07, 24 December 2021

传送门2大量使用投射纹理作为地图光照
env_projectedtexture
是一个存在于所有的 起源 游戏自从 Template:Name=Half-Life 2: Episode One 以来的点实体。它投射一个纹理作为一个动态光源,可以影响地图内所有的物体。还可以选择使用阴影贴图。 投射纹理不像其他光照实体的光照一样是预先生成的,这种光是在游戏内实时计算的,地图本身不需要经过VRAD处理就可以使用。
待完善: 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修复
- V社的游戏仅支持在同一时间内在PVS里渲染一个阴影贴图
- Template:Note:zh-cn
- Template:Warning:zh-cn
修复:可以遵循该教程修改/删除此限制。

env_projectedtexture
s。你还可以在启动参数中添加-numshadowtextures #
以提高上限。 # 是游戏应允许的阴影贴图数量。- 仅当玩家的阴影质量设置为“高”时才能显示投射纹理。如果您的阴影质量设置里不显示这一选项,你可以在游戏的启动参数里添加
-force_vendor_id 0x10DE -force_device_id 0x1180
来强制显示 - 在多人游戏里,
mat_supportflashlight
必须被设置为1才能让手电筒正常工作,在TF2中,这个指令默认被禁用,故没有特殊修改的话,该实体无法在TF2中使用 - 手臂模型不会接收来自投射纹理的任何光照和阴影,除了Gmod和传送门2。您可以按照该教程修复这个Bug。

env_projectedtexture
都不会渲染阴影。要解决此问题,请在启动参数添加-vulkan
,让游戏在Vulkan模式下运行。 [todo tested in ?]
代码修复:可以按照该教程修复此bugEnv_projectedtexture/fixes#Fixing Parenting.


实体属性(Flags)
- 1: Enabled(默认开启)
- 2: Always Update(始终更新,用于移动光源)Template:AS add:zh-cnTemplate:Mapbase also:zh-cn
键值
- Target (target) <目标名 >
- 跟着目标移动,确保勾选 Always update。
- FOV (lightfov) <浮点型 >
- 投射的fov范围

- NearZ (nearz) <浮点型 >
- 比此距离近的物体不接收投射。
- FarZ (farz) <浮点型 >
- 同上,但是比此距离远。
- Enable Shadows (enableshadows) <布尔值 >
- 投射出来的阴影是否开启。. 0 = no, 1 = yes.
- Shadow Quality (shadowquality) <Choices >
- 阴影质量
- 0: 低 (锐利的、像素化的阴影)
- 1: 高 (边缘平滑的阴影)
- Light Only Target (lightonlytarget) <布尔值 >
- 只有目标才行收到效果.
- Light World (lightworld) <布尔值 >
- 是否影响世界上的静态几何. 0 = no, 1 = yes.
- Camera Space (cameraspace) <整数 >
- 角度,对于摄像机.
- Brightness Scale (brightnessscale) <浮点型 > (存在于自 AS 以来) Template:Also:zh-cn
- 按该亮度缩放光照颜色。由于投射纹理的亮度值只能是0到255,所以使用Brightness Scale键值可以使投影纹理比255更亮。

- Color Transition Time (colortransitiontime) <浮点型 > (存在于自 AS 以来) Template:Also:zh-cn
- 改变颜色所需的时间。值越高速度越快。
- Appearance (style) <choices> (存在于自
以来)
- 各种自定义外观预设。Template:Note:zh-cn
- Custom Appearance (pattern) <字符串 > (存在于自
以来)
- 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.
aaggnnttzz
would be a steppy fade in from dark to light.
- Default Appearance (defaultstyle) <字符串 > (存在于自
以来)
输出
- TurnOn
- 开启。
- TurnOff
- 关闭
- FOV <浮点型 >
- 设置 FOV.
- EnableShadows <布尔值 >
- 设置是否显示阴影 0 = no, 1 = yes.
- SpotlightTexture <字符串 >
- 设置射灯材质.
- Target <字符串 >
- 指定一个新的 目标实体 .
- CameraSpace <布尔值 >
- 设置 Camera Space.
- LightOnlyTarget <布尔值 >
- 设置 Light Only Target.
错误:Non-functional.无效 [todo tested in ?]
- LightWorld <整数 >
- 设置 Light World. 0 = no, 1 = yes.
- LightColor <color255 > (存在于自
以来)
- Change the Light Color.
- SetLightStyle <整数 > (存在于自
以来)
- 设置 an Appearance. (see Appearance keyvalue above for possible values)
- SetPattern <字符串 > (存在于自
以来)
- 设置 Custom Appearance. (see Custom Appearance keyvalue above)
- SetNearZ <浮点型 > (存在于自
以来)
- 设置 NearZ.
- SetFarZ <浮点型 > (存在于自
以来)
- 设置 FarZ.
输出
Base/基础:
- OnUser1 to OnUser4
- 这些输出将分别响应于
FireUser1
到FireUser4
输入。 详见 User Inputs and Outputs。 - OnKilled (仅存在于
之中)
- 当实体被Kill输入时响应此输出。