Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualErik Rufelt

Posted 06 April 2013 - 07:10 AM

I plan to use hardware skinning, and thus I need to use loop inside the vertex shader

 

Hardware skinning is usually done without loops by always skinning for a static number of bones per vertex, and using weights of 0.0 when less than that are needed for a particular vertex.

In general branching and looping on variables are bad, while looping over constants will be unrolled automatically by the shader compiler.

 

 

If you haven't written a skinning shader before, then start by writing one that works on your development system, and worry about support on other platforms later. If you know how to do it with loops then do it with loops, and then post the code here and people can comment on it.

Finding the information you need and iteratively changing your method will be easy once you've written one that works.

 

If you need information on how to start, then post information on your GLSL version and hardware so we can recommend a tutorial.


#1Erik Rufelt

Posted 06 April 2013 - 07:08 AM

I plan to use hardware skinning, and thus I need to use loop inside the vertex shader

 

Hardware skinning is usually done without loops by always skinning for a static number of bones per vertex, and using weights of 0.0 when less than that are needed for a particular vertex.

In general branching and looping on variables are bad, while looping over constants will be unrolled automatically by the shader compiler, but again worry about it after it works.

 

 

If you haven't written a skinning shader before, then start by writing one that works on your development system, and worry about support on other platforms later. If you know how to do it with loops then do it with loops, and then post the code here and people can comment on it.

Finding the information you need and iteratively changing your method will be easy once you've written one that works.

 

If you need information on how to start, then post information on your GLSL version and hardware so we can recommend a tutorial.


PARTNERS