Updated Projected textures (markdown)

Blixibon 2020-06-19 10:05:20 -05:00
parent a69311e26e
commit fb75b5b82f

@ -2,12 +2,14 @@ A **projected texture** projects a texture as a dynamic light that affects the s
---
Mapbase's projected textures are a mix of [Insolence's implementation of Alien Swarm projected textures](https://github.com/95Navigator/insolence-2013/commits/master), [City 17: Episode One's projected textures](https://github.com/KyleGospo/City-17-Episode-One-Source), [G-String's projected textures](https://github.com/Biohazard90/g-string_2013), [the VDC fixes](https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes), and Mapbase's own adjustments. Most work is intended to fix the bugs surrounding projected textures in Source 2013 and enhance their capabilities. They're also compatible with maps that preclude Mapbase.
Mapbase's projected textures are a mix of [Insolence's implementation of Alien Swarm projected textures](https://github.com/95Navigator/insolence-2013/commits/master), [City 17: Episode One's projected textures](https://github.com/KyleGospo/City-17-Episode-One-Source), [G-String's projected textures](https://github.com/Biohazard90/g-string_2013), [the VDC fixes](https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes), and Mapbase's own improvements. Most work is intended to fix the bugs surrounding projected textures in Source 2013 and enhance their capabilities. They're also compatible with maps that preclude Mapbase.
Most of the work involved is based off of the Alien Swarm SDK, meaning env_projectedtextures use a lot of Alien Swarm I/O/KV and features, like the "Always Update" spawnflag. There's some other new features as well, like the ability to set the FOV's width and height separately, a feature from City 17: Episode One.
Mapbase raises the number of shadow depth textures to `5`, meaning you could safely use up to `4` projected textures at any time. However, you could use the `-numshadowtextures` launch parameter before starting the game to set the shadow map limit yourself. This is based on the Gmod launch parameter of the same name.
Mapbase also adds the ability to set the projected texture's Constant, Linear, and Quadratic attenuation, just like baked VRAD lights.
---
## Shader changes
@ -33,11 +35,19 @@ By default, Mapbase uses a shadow map resolution of `2048` with a filter size of
Even though the vast majority of these changes come from other projects, Mapbase still has its own changes that help with env_projectedtexture itself. Here's some new I/O/KV that were not ported from other projects and are not known to exist elsewhere:
**KeyValues**
* **Always Draw** `<boolean>` - Forces the projected texture to always draw, regardless of whether the player can see its frustum. This is for projected textures that can be seen on monitors or are in the skybox.
* **Don't follow target** `<boolean>` - Prevents the projected texture from actually following its target, if it has one. Intended to be used with "Light Only Target" so it only lights the target without actually following it.
* **Constant** `<float>` - The light's constant attenuation, giving the light no falloff. (This value is internally corrected with x*0.5)
* **Linear** `<float>` - The light's linear attenuation, giving the light linear decline. This is the most common attenuation for projected textures. (This value is internally corrected with x*100)
* **Quadratic** `<float>` - The light's quadratic attenuation, giving the light exponentially decreasing falloff. (This value is internally corrected with x*10000)
* **Shadow Atten** `<float>` - The attenuation of the shadows, or how much the shadows should fade into the light of the projected texture, if at all. The player's flashlight uses 0.35 by default, although higher values may be needed for a visible effect.
* **Always Draw** `<bool>` - Forces the projected texture to always draw, regardless of whether the player can see its frustum. This is for projected textures that can be seen on monitors or are in the skybox.
* **Don't follow target** `<bool>` - Prevents the projected texture from actually following its target, if it has one. Intended to be used with "Light Only Target" so it only lights the target without actually following it.
**Inputs**
* **AlwaysDrawOn/Off** `<void>` - Toggles the "Always Draw" keyvalue.
* **SetConstant** `<float>` - Sets the constant attenuation.
* **SetLinear** `<float>` - Sets the linear attenuation.
* **SetQuadratic** `<float>` - Sets the quadratic attenuation.
* **SetShadowAtten** `<float>` - Sets the shadow attenuation.
---