momentum-mod / game

Momentum Mod - Standalone Source Movement Speedrunning (READ README)
https://momentum-mod.org
Other
531 stars 210 forks source link

Parallax distortion on PBR textures #1655

Open tsa96 opened 2 years ago

tsa96 commented 2 years ago

Describe the bug

Encountered some very strange distortion in the parallax calculations in the PBR shader on CrancK's WIP map. Some textures coords seems to be flying off to infinity or something at tiny grazing angles.

How To Reproduce

Open CrancK's map posted here and try looking at some walls from very sharp angles. https://discord.com/channels/235111289435717633/719632195982983308/927554954976178188

Map is compiled for Chaos so can't open to test on 0.8.7 I've looked at the heightmaps and they seem completely normal, so I'm confident it's an issue with the shader itself. However, this is occurring on both DX11 and DX9 so may not be caused by recent DX11 changes, I don't know when DX9 PBR was last compiled.

https://user-images.githubusercontent.com/35813309/148654616-76ea33a8-b310-4bb3-8668-0c6652e1e098.mp4

Expected Behavior

Sensible Parallax behaviour

Operating System

Windows

Renderer

DX11 (default)

tsa96 commented 2 years ago

The more I look at this the more confused I get, it seems to be occurring on every texture but only in certain places, maybe most commonly when nearby a brush that's positioned at an angle?? It's really bizarre, if there's not something obvious from the shader code it might be best if I make a test map to figure out exactly where this is and isn't happening. Don't have a ton of time right now but could jump over and help out with testing this if needed.