Can we have more shader functions to complement the set that we already have. for example, a Matrix Inverse and a Matrix transpose would be very helpful especially in skinning.

Thanks.

Can we have more shader functions to complement the set that we already have. for example, a Matrix Inverse and a Matrix transpose would be very helpful especially in skinning.

Thanks.

If i am not mistaken those matrices were added in GLSL 1.1.

no, these are states. I am talking about functions that can perform on given uniforms.

matrix inverse is very complex operation - itâ€™s very inefficient to perform it on every vertex/fragment. youâ€™d better invert it in your code and send as uniform.

There simply arenâ€™t enough uniforms to hold both bones and their inverse transforms.

if you have a skeleton made up of 36 bones, then you need 36 * 8 uniforms = 288 uniforms.

current HW only supports 256 native uniforms.

the only other way is to brake up the model in parts and render each part separately, which in my opiion is inefficient and convoluted.

True.

However, i assume you know how to invert a matrix (with all the Determinants and stuffâ€¦). Then you know, that performing this in a vertex-shader needs more processing power and hardware resources than (current high end) hardware can give you.

At the moment you are pretty much stuck. I had the same problem. The only thing you can try, is to use quaternions to rotate your skeleton, instead of matrices, that can cut down memory consumption by half. But still you wonâ€™t be able to use many bones.

It WILL get better, with future hardware, which supports more uniforms. But right now, itâ€™s really difficult. Either perform it on the CPU or wait for better hardware, if that is an option.

There are many reasons, why ie. the Doom Engine does all the skinning on the CPU. Itâ€™s not only the stencil-shadowsâ€¦

Jan.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.