Updated Graphical Changes (markdown)

Blixibon 2019-08-29 17:15:59 -05:00
parent c321ff8f60
commit 8960ea6bb6

@ -1,33 +1,19 @@
This article is an overview for Mapbase's changes that alter the game's graphics and have a visible effect in-game. There aren't many of these changes, and they're usually just bug fixes or general quality-of-life improvements.
While part of the point of Mapbase is to improve modding and mapping without changing too much of the game itself, there are a few exceptions listed on this page. Most of these changes are negligible and/or controlled by the mapper. *(although the shader changes are something to keep in mind)*
### Projected textures
---
<p align="center">
<img src="https://i.imgur.com/RiYso9A.jpg" width="256"/>
<img src="https://i.imgur.com/z57RxZl.jpg" width="256"/>
<img src="https://i.imgur.com/JQfp7DN.png" width="384"/>
<img src="https://i.imgur.com/swyPU3U.png" width="256"/>
</p>
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), [the VDC fixes](https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes), and Mapbase's own adjustments.
**Main article:** *[Projected textures](Projected-textures)*
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.
Projected textures have been drastically improved with changes from Alien Swarm and several open-source projects. See the main article for more information.
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)
These changes involve the game DLLs as well as the shaders, so many of the fixes go beyond what the VDC fixes covered, like the "reverse projection" bug or decals not receiving shadows correctly.
**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](https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes#Lowering_the_amount_of_.22grain.22_on_shadows) for more information.
<strong style="margin-left:1em; color:#D31B1B; white-space:nowrap;"><img src="https://developer.valvesoftware.com/w/images/c/cb/Warning.png"/> Warning:&nbsp;</strong> Some of the fixes require materials to use new shaders. See (put page here) for more information.
### env_global_light
---
(put images here)
env_global_light is an orthographic projected texture, like an env_projectedtexture that only casts shadows in one direction. This is another thing Insolence ported from Alien Swarm that ended up being gleaned into Mapbase. I have taken a few liberties with it, like setting the offset cvars to 0 and turning them into keyvalues so mappers can control it, but it's a bit disappointing and I don't really expect it to be used very much.
Like the projected textures, this requires the material shader changes to take advantage of certain fixes.
<strong style="margin-left:1em; color:#D31B1B; white-space:nowrap;"><img src="https://developer.valvesoftware.com/w/images/c/cb/Warning.png"/> Warning:&nbsp;</strong> Some of the changes require materials to use custom shaders. See [Shader changes](Shader-changes) for more information.
### Radial fog
---
@ -36,9 +22,9 @@ Like the projected textures, this requires the material shader changes to take a
<img src="https://cdn.discordapp.com/attachments/564491020344098827/603075488231063563/background020016.jpg" width="384"/>
</p>
Mapbase uses the radial fog created by the Half-Life 2: Downfall team. While regular Source fog is calculated in only one dimension _(which is why you could see through it on the edges of your screen)_, Radial fog is calculated in 3D to create a sphere of fog around the player. This means the fog looks more realistic and won't move around when you rotate your camera.
Mapbase uses Half-Life 2: Downfall's implementation of Alien Swarm's radial fog. This means fog is calculated radially and doesn't change as you rotate the camera, unlike planar fog.
<strong style="margin-left:1em; color:#D31B1B; white-space:nowrap;"><img src="https://developer.valvesoftware.com/w/images/c/cb/Warning.png"/> Warning:&nbsp;</strong> Radial fog requires materials to use new shaders. See (put page here) for more information.
<strong style="margin-left:1em; color:#D31B1B; white-space:nowrap;"><img src="https://developer.valvesoftware.com/w/images/c/cb/Warning.png"/> Warning:&nbsp;</strong> Radial fog requires materials to use custom shaders. See [Shader changes](Shader-changes) for more information.
### Dynamic RTT shadow angles
---
@ -46,12 +32,18 @@ Mapbase uses the radial fog created by the Half-Life 2: Downfall team. While reg
<img src="https://developer.valvesoftware.com/w/images/6/67/Dynamic_rtt.jpg" width="448"/>
</p>
Mapbase uses [Saul Rennison's dynamic RTT shadow angles from the VDC](https://developer.valvesoftware.com/wiki/Dynamic_RTT_shadow_angles_in_Source_2007), based directly on [Insolence commits](https://github.com/95Navigator/insolence-2013/commit/410bcbcc1d5d413bd7a19875b200d30134030aa3). Dynamic RTT shadows angles are off by default and must be enabled through an input/keyvalue in shadow_control, an option which Insolence seems to have added themselves. It still has the same problems it did before, like visibly lerping from light to light.
Mapbase uses [Saul Rennison's dynamic RTT shadow angles from the VDC](https://developer.valvesoftware.com/wiki/Dynamic_RTT_shadow_angles_in_Source_2007), which lerp from local lights and don't stay in one constant direction all the time. This feature is off by default and must be enabled through an input/keyvalue in shadow_control, an option from later Source games.
Fun fact: These were originally implemented by accident.
Fun fact: This was originally implemented by accident.
### Brush phong (phong on LightmappedGeneric)
---
(put image here)
<p align="center">
<img src="https://i.imgur.com/z57RxZl.jpg" width="256"/>
</p>
This was originally from City 17: Episode One, but it was brought through Insolence commits. This isn't something Mapbase would normally implement, but it was requested and its proximity to the projected texture stuff made it easier to port than to avoid. It's only activated through specific VMT parameters and masks anyway.
Todo: up-to-date image, maybe unique article for both "Shader changes" and this to link to (or even merge this and shader changes)
"Brush phong" is phong reflections on brush shaders, like `LightmappedGeneric` (or in this case `SDK_LightmappedGeneric)`. It reflects the flashlight beautifully and supports exponent masking.
<strong style="margin-left:1em; color:#D31B1B; white-space:nowrap;"><img src="https://developer.valvesoftware.com/w/images/c/cb/Warning.png"/> Warning:&nbsp;</strong> Brush phong requires materials to use custom shaders. See [Shader changes](Shader-changes) for more information.