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

anim: GPU skinning #110

Open
kikonen opened this issue Sep 22, 2024 · 0 comments
Open

anim: GPU skinning #110

kikonen opened this issue Sep 22, 2024 · 0 comments
Labels

Comments

@kikonen
Copy link
Owner

kikonen commented Sep 22, 2024

Steps

  1. Calculate animation & anim blending in CPU and generate bone palette matrices
  2. In compute shader pre-transform all vertices for skinned meshes with bone matrices

=> Theorem is that this reduces needed calculations, especially since, every mesh need to be drawn from multiple different camera viewpoints for every frame, upto 45 times.


Trivia: When single scene is drawn, full scene is drawn basically 45 times

  • cube map 6 sides
    • water x2/mirror/normal per side
    • nested water x2 for mirror
    • thus 6 per side
    • => 36 total
  • mirror
    • reflection
    • nested water x2 for mirror
    • => 3 total
  • water
    • 2x times (reflection/refraction)
    • => 2 total
  • shadow map
    • 3 casdades
    • => 3 total
  • normal scene
    • => 1 total

Thus approximately 45 times per frame. However, cheating, thus not drawing everything on every frame. But still 20+ times per frame averages

=> However, this means also that mesh vertices must be multiplied per for every animated mesh, to store pre-calculated verticies. Overhead of this is potentially eating away benefits for big meshes with thousands of vertices

@kikonen kikonen added the big label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant