Open Icensow opened 5 years ago
Caused by two linked issues: 1) Slow down when applying vertex shaders to peds: Reason is because GTA uses GPU vertex shaders for fast ped animation. Applying an MTA vertex shader forces GTA to switch to a (slower) software method for ped animation.
2) Still slow after removing vertex shader: Reason is because GTA is still using software method for existing ped models. It will switch back eventually, but there is currently no reliable method for forcing it. Unloading the DFF + delay + reloading the DFF multiple times can sometimes help.
Commit which enable ped vertex shaders: 0a6db563
Switching GTA between GPU/software animation is done in CRenderWareSA::SetGTAVertexShadersEnabled
Isnt it theoretically possible to draw Peds/Players without applied shaders with the GPU method and draw everything else with the slow software method? This way we could optimize our resources by removing shaders from far away / offscreen Peds or only apply shaders to a limited amount of them and Performance can increase dramatically!
Describe the bug A vertex shader applied only to certain ped (using targetElement argument) also handles vertices of all streamed peds that have a texture with same name and it causes FPS drop. Removing the shader from the texture doesn't resolve it. Destroying the shader also gives no results.
To reproduce
Expected behaviour No FPS drop (the shader should handle only the vertices of target element) or at least removing shader should fix it.
Screenshots
Version Multi Theft Auto v1.5.6-release-14664.4
Additional context Video show the issue: https://www.youtube.com/watch?v=5FpgHOrnxLc