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

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{lang|Env projectedtexture}} thumb|Env_projectedtexture has different appearances File:Projected texture.jpg|thumb|Projecting...")
 
(Blanked the page)
Tag: Blanking
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{lang|Env projectedtexture}}
[[File:Env projectedtexture appearances.jpg|thumb|Env_projectedtexture has different appearances]]
[[File:Projected texture.jpg|thumb|Projecting a colorful [[texture]] in [[Garry's Mod]].]]
[[File:Global_shadow_mapping.jpg|thumb|[[Portal 2]] uses projected textures extensively for world lighting.]]
[[File:volumetric_projected_texture_p2ce.jpg|thumb|Showcase of {{P2CE}} volumetrics in a [[Portal 2]] map.]]
{{base point|env_projectedtexture|since=Half-Life 2: Episode One}} It projects a [[texture]] as a dynamic light that affects all objects in the world, optionally with [[Wikipedia:Shadow mapping|Shadow Mapping]]. env_Projectedtexture does not light the world similarly that other light entities which are ray-traced when you compile the map. This light however is real-time and works without RAD.


{{Warning|This is the most expensive light entity in the engine. Use sparingly.}}
{{code class|CEnvProjectedTexture|env_projectedtexture.cpp}}
==Caveats and Fixes==
{{main|Env_projectedtexture/fixes}}
*Valve's games only support one shadow map in the [[PVS]] at a time.
: {{warning|{{csgo}} Only one projected texture can ever be active in the map, regardless of shadow settings}}
: {{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.}}
{{note|{{P2CE}} increases this limit to 8.}}
{{note|In {{Mapbase}}, you could use up to 4 projected textures at any time. This number can be increased by <code>-numshadowtextures #</code> in the Steam launch parameters of mod, or via block <code>CommandLine</code> of parameters in gameinfo.txt.}}
*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.
* {{note|In {{csgo}}, shadows from <code>env_projectedtexture</code> work on "Low" video settings.}}
*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, with the exception of Garry's Mod and Portal 2. 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|In Portal 2, while running in DirectX 9 mode, some graphics cards will not render shadows from <code>env_projectedtexture</code> regardless of the shadow detail setting. To fix this, run the game in Vulkan mode with the launch parameter <code>-vulkan</code>.}}
{{bug|Parenting does not work with stock SDK code.}}
: {{fix|This bug is fixable by following these instructions: [[Env_projectedtexture/fixes#Fixing Parenting]].|code}}
{{bug|{{csgo}} No smooth transition between this light and {{ent|env_cascade_light}}.}}
===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.}}
: {{fix|You can fix this issue by following these instructions: [[Env_projectedtexture/fixes#Fix_configurable_texture_value_in_Hammer]].|code}}
{{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."}}
{{bug|The entity cannot target another entity.}}
: {{fix|This bug is fixable by following these instructions: [[env_projectedtexture/fixes#Fixing targeting]].|code}}
{{bug|[[Model]]s will not receive their own shadows correctly unless using [[$bumpmap]]. Even a flat bump map is sufficient.}}
{{bug|Causes issues if the entity overlaps a portal in [[Portal|Portal 1]]. Simply the projection overlapping a portal works fine.}}
==Flags==
*1: Enabled
*2: Always Update (moving light){{AS add}}{{Mapbase also}}
==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