-
Notifications
You must be signed in to change notification settings - Fork 169
Projected textures
A projected texture projects a texture onto the surfaces of brushes/models and (optionally) casts dynamic shadows. It's normally used to create dynamic light, like the player's flashlight. Mappers can place their own projected textures via the "env_projectedtexture" entity. Click here for more information on projected textures in Source.
In most Source games, only one shadow-casting projected texture could be active at the time, including the player's flashlight. It also suffered from several noticeable bugs in earlier branches of the engine, including Source 2013.
In Mapbase, projected textures have become more stable, more flexible, and much more usable. Most of the bugs they suffered from in Source 2013 have been fixed and up to 5 shadow-casting projected textures can be active at a time, including the player's flashlight.
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 uses shader code from Insolence's repository, which includes projected texture stuff ported from Alien Swarm. This fixes the reverse projection bug, adds a reflection, changes the way projected textures fade out, and more.
The projected textures in the following pictures have had their brightness scaled by 5 to make them more visible.


Mapbase's projected textures are a mix of Insolence's implementation of Alien Swarm projected textures, City 17: Episode One's projected textures, the VDC fixes, and Mapbase's own adjustments.
(talk about stuff here)


For the most part, Insolence's code was just gathered from Alien Swarm and other (credited) projects for its own purposes, but the vast majority of Mapbase's projected texture code--including all of the shader changes--were cherry-picked from Insolence commits.
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 new features as well, like the ability to set the FOV's width and height separately. (this causes shadow bugs, so be careful)
In Mapbase, up to 5 projected textures with shadows enabled can be active at one time, including the player's flashlight. However, you could use the "-numshadowtextures" launch parameter before starting the game to set the projected texture limit. This is based on the Gmod launch parameter of the same name.
By default, Mapbase uses a shadow map resolution of 2048 with a filter size of 0.5. This can be changed in imaterialsystem.h. See this section on the Valve Developer Community for more information.
-
Something Index
- Something special
- Something else