Env projectedtexture
< Zh
Jump to navigation
Jump to search

传送门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: Low (sharp, pixelized shadows) 低
- 1: High (smooth edged shadows) 高
- Light Only Target (lightonlytarget) <布尔值 >
- 只有目标才行收到效果.
- Light World (lightworld) <布尔值 >
- 是否影响世界上的静态几何. 0 = no, 1 = yes.
- Camera Space (cameraspace) <整数 >
- 角度,对于摄像机.
- Simple Projection (simpleprojection) <布尔值 > (存在于自 AS 以来) 不存在于FGD!
- Indicates if this is a simple, non-light casting texture projection.
- Brightness Scale (brightnessscale) <浮点型 > (存在于自 AS 以来) Template:Also:zh-cn
- Scale the light color by this brightness.
- Color Transition Time (colortransitiontime) <浮点型 > (存在于自 AS 以来) Template:Also:zh-cn
- Amount of time it takes for a color change to occur. Higher numbers cause faster transitions.
- Appearance (style) <choices> (存在于自
以来)
- Various Custom Appearance presets.
注意:Requires AlwaysUpdateOn to work.
- 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输入时响应此输出。