Configurable Parallax Depth Settings #1129
Labels
Outcome: Resolved
This was resolved, and will be in a future update.
Priority: Low
Something not very essential to the release, can be done in free time and bumped back if needed.
Size: Medium
Something that may take a few days or so to implement.
Type: Enhancement
This can improve a system/thing already in place.
Projects
What feature is your improvement idea related to? Please describe.
Currently PBR textures with high parallax occlusion depth show significant "layers", due to a relatively low hardcoded value within the shader code
game/mp/src/materialsystem/stdshaders/pbr_common_ps2_3_x.h
Line 182 in 5f8c817
Modern graphics cards can comfortably handle a higher value than this (my GTX 960 has a 5-10% performance drop on a shader compiled with the value set to 128, when surrounded by 2048x2048 parallax textures).
Additionally, the constant numSteps value means doing a needless number of steps for textures with a very low depth value.
Describe the solution you'd like
Pass a new value into the shader to vary the number of steps proportional to both the $parallaxdepth parameter and a graphics setting. Ideally this would be something configurable in the video settings, though if this requires engine access it could depend on the Texture Detail (mat_picmip) setting (as far as I can tell, the maximum setting ("Very High", mat_picmip -1) doesn't even affect texture scaling).
I suggest having the numSteps value range based on the mat_picmip setting with:
Medium Texture Scaling (picmip 1) - Min: 4, Max: 16
High Texture Scaling (picmip 0) - Min: 8, Max: 32
Very High Texture Scaling (picmip 1) - Min: 16, Max: 64
linearly interpolated between $parallaxdepth of 0 and 0.1. (0.1 is a considerably high depth).
Most textures with mild parallax detail have a depth of around 0.02 - 0.05, so this shouldn't result in any performance loss for anyone unless (a) they're in an area with a lot of highly parallaxed textures and (b) they're running with "Very High" texture settings. Most users who select "Very High" likely have GPUs will comfortably maintain 300+ FPS regardless.
Note that POM is only included in PBR ps30, which has 224 constant registers, so passing new parameters to the shader isn't an issue as with features compatible with ps20b.
Describe alternatives you've considered, if any
Its own graphics setting would be nice, or just a cvar, but it would be best to ensure people with decent machines who've selected highest possible graphics settings have this change by default.
Additional context
Here's a texture with $parallaxdepth 0.1 on Steam build (20 slices) with very visible layering appearing.
The text was updated successfully, but these errors were encountered: