diff --git a/Projected-textures.md b/Projected-textures.md index fa95d40..99f8b80 100644 --- a/Projected-textures.md +++ b/Projected-textures.md @@ -1,22 +1,30 @@ -A **projected texture** projects a texture as a dynamic light that affects the surfaces of brushes/models and (optionally) casts dynamic shadows. Mappers can place their own projected textures via the "env_projectedtexture" entity. [Click here for more information on projected textures in Source.](https://developer.valvesoftware.com/wiki/Env_projectedtexture) +**Projected textures** are basically dynamic lights which can cast dynamic shadows. Mappers can place their own projected textures via the `env_projectedtexture` entity. [Click here for more information on projected textures in Source.](https://developer.valvesoftware.com/wiki/Env_projectedtexture) --- -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. +Mapbase's projected textures are made from tons of custom code gathered from the Alien Swarm SDK and open-source projects all over the Source community. -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. +They were first created using [Insolence's implementation of Alien Swarm projected textures](https://github.com/95Navigator/insolence-2013/commits/master), which in turn has improvements from [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), and [the VDC fixes](https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes). From this, Mapbase adds its own improvements, like texture clipping fixes or Constant/Linear/Quadratic attenuation control. + +`env_projectedtexture` in Mapbase uses a lot of new I/O/KV. Instead of automatically updating when parented, there is now an "Always Update" spawnflag for control over whether the projected texture updates. However, projected textures made before Mapbase (detected by checking a static keyvalue) will still use the VDC fix for automatically updating when there's a parent. This means Mapbase's projected textures are fully compatible with maps that preclude Mapbase. 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 -Mapbase uses shader code from the aforementioned projects, including Alien Swarm, G-String, City 17: Episode One, etc. The shader changes alone fix most of the bugs the VDC fixes couldn't fix, including the "reverse projection" bug and the bug with decals not receiving casted shadows. +Mapbase uses shader code from the aforementioned projects, including Alien Swarm, G-String, City 17: Episode One, etc. The shader changes alone fix most of the bugs the VDC fixes couldn't fix, including the "reverse projection" bug and the bug with decals not receiving casted shadows. These shader changes also use a new shadow calculation method which makes shadows appear much sharper. -The changes also fix a long-standing bug with Source 2013 projected textures that calculates the attenuation with the player's view, rather than the light's origin. This is very noticeable in the comparison pictures. +

Before:

+

+ +

After:

+

+ +

+ +The changes also fix a long-standing bug with Source 2013 projected textures that calculates the attenuation with the player's view, rather than the light's origin. This is very noticeable in the comparison pictures below.

The projected textures in the following pictures have had their brightness scaled by 5 to make them more visible.