Jump to content

Animation Conventions GLSL


Pryme8
 Share

Recommended Posts

I need information on how to create a custom shader that can handle multiple mesh clones all playing different animations.

Im not sure where to look or what the convention is.  I was kinda under the impression that if a mesh needed a different animation or different timing it needs a different shader or some sort of VBO data to dictate a different mesh identifier/animation.  

Any clues or suggestions?

Link to comment
Share on other sites

If anyone has any links or articles on this, anything at this point would be appreciated.

I will be able to make it happen I just need the information on industry convention. 

Cause right now I am picturing having to have an array defined with the same index count as the number of cloned meshes sharing the shader.  Then have the meshes have an extra VBO value that assigns the same ID as the  index value for the array  on the meshs vertices, then on the shader iterate through the array applying the assigned animations... 

Thats just a thought though and I doubt is the correct way.

Link to comment
Share on other sites

I need it for skeletal weighted animations though, not position/vertex manipulation.

I am waiting to see if its a single animation that needs different playback timings, if that is the case then I think I got it figured out.

Link to comment
Share on other sites

1) Are bjs normal materials handled by shaders? If so, can that logic be imitated? How can a bjs normal material be shared with any number of meshes while supporting rendering different animation frames in all of them?

2) Would it substantially affect performance if there were 400 shader material clones if only 20 of them were actually rendered? (The rendered 20 are constantly replaced from a pool of 400)

Link to comment
Share on other sites

Yes all materials are handled by shaders.  I already did. I do not believe it does I think it only has animation instancing and when you need a cloned mesh playing a different animation I think it needs whole new material.  I am prolly be mistaken though.

The second part I am not sure, I think as long as one 20 are being rendered out of the pool it should not effect draw performance (I dont think)  but will require a substantial chunk of memory to hold the 400 entities.

Link to comment
Share on other sites

I don't think so, unless cloning a mesh automatically clones its material as well under the hood. I have different clones of the same mesh showing different frames of different animations, I never cloned a material manually.

 

6 minutes ago, Pryme8 said:

but will require a substantial chunk of memory to hold the 400 entities.

How substantial?

Link to comment
Share on other sites

yea it clones the material as well, I am not sure if that means it creates a new draw call or not though.

top of my head lets say (35*15clones) meshes plus 400 shaders ummm... 50-200 mb kinda hard to estimate that unless I knew the mesh sizes, the shaders should only be like 10mb at most I would guess.. but then again I am just tossing numbers out there I am not an expert on how the GPU/CPU caches resources.

*DISCLAIMER*
I am talking out my a** now...  I have no clue about the ram equivalencies. 

 

Link to comment
Share on other sites

12 hours ago, Pryme8 said:

yea it clones the material as well, I am not sure if that means it creates a new draw call or not though.

Interesting, I wonder if it does.

 

12 hours ago, Pryme8 said:

I am talking out my a** now...  I have no clue about the ram equivalencies. 

lol, that's a great amount of ram for a web app so I do hope these numbers are far fetched.

 

8 hours ago, NasimiAsl said:

can i ask what animation and what mesh you wanna do ? 

I have many low poly models exported in blender, each of them has 2 animations.

I'm trying to apply an underwater effect to all of them - it's achieved by a shader material Andy created, but there's the problem of.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...