Canyon Rock Optimizations
While I think of myself as a programmer, one thing I am not at all proficient at is Shader programming. I generally rely on open source or packaged shaders to get complex effects, one of which is the snow covering on rocks in the game.
The way it works is by having a rock texture base that has its own normal maps, tiling, etc. And then having an "Overlay Mask" that screens on another set of texture/normal/tiling (in this case snow).
However, the shader used to do this and get the right effect was really complicated. It had space for 4 different masks all overlaid on top of each other, and we're only using one. The catch is that even if we don't use those extra slots, the GPU still does those calculations, just using 0 for everything (and not changing the final outcome).
So after a bit of trial and error, I was able to cut out all those other slots from the shader code, bringing it down from 188 lines to 102 lines, which is compounded over each frame's rendering and all of the hundreds of rocks in the scene! Hopefully we'll get a nice performance boost out of this change.
Fixes
- Fixed issue with invincible singleplayer gates
- Fixed frozen boss issue in multiplayer
- Fixed issue with Continue panel not appearing in multiplayer
- Fixed issue with repeated 'lose' routine in multiplayer
