Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertex shader FPS drop #675

Open
Icensow opened this issue Oct 29, 2018 · 2 comments
Open

Vertex shader FPS drop #675

Icensow opened this issue Oct 29, 2018 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@Icensow
Copy link

Icensow commented Oct 29, 2018

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

  1. Spawn
  2. Start shader_bug.zip
  3. Input command "dropfps"
  4. See FPS drop
  5. Input command "tryfix" (removes the shader)
  6. See no difference

Expected behaviour
No FPS drop (the shader should handle only the vertices of target element) or at least removing shader should fix it.

Screenshots
mta-screen_2018-10-29_13-16-28
mta-screen_2018-10-29_13-16-39

Version
Multi Theft Auto v1.5.6-release-14664.4

Additional context
Video show the issue: https://www.youtube.com/watch?v=5FpgHOrnxLc

@botder botder added the bug Something isn't working label Oct 30, 2018
@ccw808
Copy link
Member

ccw808 commented Nov 4, 2018

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: 0a6db56
Switching GTA between GPU/software animation is done in CRenderWareSA::SetGTAVertexShadersEnabled

@botder botder added this to the Backlog milestone Mar 3, 2019
@Einheit-101
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants