User:Yakumo koishi/env projectedtexture:zh-cn: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(Blanked the page)
Tag: Blanking
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{lang|Env projectedtexture}}
[[File:Env projectedtexture appearances.jpg|thumb|Env_projectedtexture有着不同的外观]]
[[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]]地图上的体积光效果]]
{{base point:zh-cn|env_projectedtexture|since=Half-Life 2: Episode One}}它投射一个[[Texture|纹理]]作为一个动态光源,可以影响地图内所有的物体。还可以选择使用[[Wikipedia:Shadow mapping|阴影贴图]]。 投射纹理不像其他光照实体的光照一样是预先生成的,这种光是在游戏内实时计算的,地图本身不需要经过[[VRAD]]处理就可以使用。


{{Warning:zh-cn|这是起源里最吃配置的实体,谨慎使用}}
{{code class:zh-cn|CEnvProjectedTexture|env_projectedtexture.cpp}}
==注意事项与Bug修复==
{{main:zh-cn|Env_projectedtexture/fixes}}
*V社的游戏仅支持在同一时间内在[[PVS]]里渲染一个阴影贴图
: {{note:zh-cn|自{{ep2}},玩家的手电筒也是阴影贴图}}
: {{warning|在{{csgo}}中,无论阴影质量设置如何,都只能在地图内使用一个投射纹理}}
: {{fix|可以[[Env_projectedtexture/fixes#Enabling_multiple_shadow_maps.|遵循该教程]]修改/删除此限制。}}
*被投射的纹理需要勾选Clamp S, Clamp T and Clamp All选项,以避免突兀的平铺。以及,投射纹理是直接使用[[VTF]]的,不需要[[VMT]]
{{note|在[[Garry's Mod|Gmod]]中,可以同时有9个启用的<code>env_projectedtexture</code>s。你还可以在启动参数中添加<code>-numshadowtextures #</code>以提高上限。  # 是游戏应允许的阴影贴图数量。}}
{{note|{{P2CE}}将此上限提高到了8}}
{{note|在{{Mapbase}}里,你可以同时使用4个投射纹理。 这个上限可以通过启动参数<code>-numshadowtextures #</code>或者gameinfo.txt中的<code>CommandLine</code>部分来增加。}}
*仅当玩家的阴影质量设置为“高”时才能显示投射纹理。如果您的阴影质量设置里不显示这一选项,你可以在游戏的启动参数里添加<code>-force_vendor_id 0x10DE -force_device_id 0x1180<、code>来强制显示
* {{note|在{{csgo}}里,<code>env_projectedtexture</code>产生的阴影在阴影质量设置为“低”时显示}}
*在多人游戏里,<code>mat_supportflashlight</code>必须被设置为1才能让手电筒正常工作,在[[Team Fortress 2|TF2]]中,这个[[Cvar|指令]]默认被禁用,故没有特殊修改的话,该实体无法在TF2中使用
*[[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|细节纹理]]}}
: [https://www.youtube.com/watch?v=PJ1mnJHln5Q 描述此bug的视频]
{{bug|在传送门2中,当游戏在DirectX 9模式下运行时,无论阴影质量设置如何,在某些显卡上<code>env_projectedtexture</code>都不会渲染阴影。要解决此问题,请在启动参数添加<code>-vulkan</code>,让游戏在Vulkan模式下运行。}}
{{bug|实体绑定在原版SDK代码中无法使用}}
: {{fix|可以按照该教程修复此bug[[Env_projectedtexture/fixes#Fixing Parenting]].|code}}
{{bug|{{csgo}}投射纹理与{{ent|env_cascade_light}}之间没有平滑过渡}}}}
==实体属性==
*1: Enabled(默认开启)
*2: Always Update(始终更新,用于移动光源){{AS_add:zh-cn}}{{Mapbase also:zh-cn}}
==Keyvalues==
{{KV|Target|intn=target|targetname|The entity will rotate to point at this target. Make sure you check the ''Always update'' flag if you set this.}}
{{KV|FOV|intn=lightfov|float|The field of view cone/pyramid at which the texture is projected.
:{{confirm|This keyvalue does not work in Alien Swarm.}}}}
{{KV|NearZ|intn=nearz|float|Objects closer than this will not receive the light from the projection.}}
{{KV|FarZ|intn=farz|float|Objects beyond this distance will not receive the light from the projection.}}
{{KV|Enable Shadows|intn=enableshadows|boolean|Enables/disables shadows from this projected texture. 0 {{=}} no, 1 {{=}} yes.}}
{{KV|Shadow Quality|intn=shadowquality|choices|Quality of shadows.
:*0: Low (sharp, pixelized shadows)
:*1: High (smooth edged shadows)}}
{{KV|Light Only Target|intn=lightonlytarget|boolean|Limit flashlight effect to only affect target entity.}}
{{KV|Light World|intn=lightworld|boolean|Control whether flashlight affects static world geometry. 0 {{=}} no, 1 {{=}} yes.}}
{{KV|Light Color|intn=lightcolor|color255 + int|Light color and intensity.}}
{{KV|Camera Space|intn=cameraspace|integer|Angles are interpreted as being relative to camera.}}
{{KV|Texture Name|intn=texturename|string|nofgd=1|The [[texture]] which this entity projects. Must be a [[VTF]] file (not VMT), relative to <code>/materials</code>.}}
{{KV|Texture Frame|intn=textureframe|int|nofgd=1|If the texture is animated, this is the frame it should begin on.}}
{{KV|Simple Projection|intn=simpleprojection|since=AS|nofgd=1|boolean|Indicates if this is a simple, non-light casting texture projection.}}
{{KV|Simple Projection Size|intn=projection_size|float|Size of the simple projection.|since=AS|nofgd=1}}
{{KV|Simple Projection Rotation|intn=projection_rotation|since=AS|nofgd=1|float|}}
{{KV|Brightness Scale|intn=brightnessscale|float|since=AS|also=Mapbase|Scale the light color by this brightness.}}
{{KV|Color Transition Time|intn=colortransitiontime|float|since=AS|also=Mapbase|Amount of time it takes for a color change to occur. Higher numbers cause faster transitions.}}
{{KV|Appearance|intn=style|choices|since=P2|also=GMOD|Various Custom Appearance presets. {{Note|Requires input <code>AlwaysUpdateOn</code> to work.}} }}
{{light appearances}}
{{KV|Custom Appearance|intn=pattern|string|since=P2|also=GMOD|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|intn=defaultstyle|string|since=P2|}}
{{KV|Enable Volumetrics|boolean|only={{P2CE}}|intn=volumetric|Whether or not to use volumetrics for this projected texture.}}
{{KV|Volumetric Intensity|float|only={{P2CE}}|intn=volumetricintensity|Defines the intensity of the volumetrics. (Default is 1. Can go above; no strict limit)}}
{{KV BaseEntity|css=1}}
==Inputs==
{{note|In some [[FGD]]s, only <code>TurnOn</code>, <code>TurnOff</code> and <code>FOV</code> are present.}}
{{IO|TurnOn|Turns on the texture.{{confirm|In [[gmod]] projected lights always start on even when "enabled" is not checked.}}}}
{{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.
:{{note|Disabled in {{portal2}} onwards. Fixed in {{P2CE}}}}}}
{{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'''.}}
{{IO|LightWorld|param=int|Sets '''Light World'''. 0 {{=}} no, 1 {{=}} yes.}}
{{IO|AlwaysUpdateOn|since=AS|Turn on per frame updating (for moving lights).|also=Mapbase}}
{{IO|AlwaysUpdateOff|since=AS|Turn off per frame updating (for moving lights).|also=Mapbase}}
{{IO|LightColor|since=AS|param=color255|Change the '''Light Color'''.|also=Mapbase}}
{{IO|SetBrightness|param=float|Sets the brightness.|only={{Mapbase}}}}
{{IO|SetLightStyle|param=integer|Sets an '''Appearance'''. (see Appearance keyvalue above for possible values)|since=P2|also=GMOD}}
{{IO|SetPattern|Sets '''Custom Appearance'''. (see Custom Appearance keyvalue above)|param=string|since=P2|also=GMOD}}
{{IO|SetNearZ|Sets '''NearZ'''.|param=float|since=P2|also=GMOD}}
{{IO|SetFarZ|Sets '''FarZ'''.|param=float|since=P2|also=GMOD}}
{{IO|EnableVolumetrics|param=boolean|Enables or disables volumetrics.|only={{P2CE}}}}
{{IO|SetVolumetricIntensity|param=float|Sets the intensity of the volumetrics. (Default is 1. Can go above; no strict limit)|only={{P2CE}}}}
{{IO|SetBrightnessScale|param=float|Sets the brightness.|only={{P2CE}}}}
{{I BaseEntity}}
==Outputs==
{{O BaseEntity|l4d=1}}
[[Category:Lighting]]

Latest revision as of 15:45, 25 September 2024