LWJGL
May 26, 2013, 02:07:56 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: [SOLVED] Skeletal Animation Shader  (Read 685 times)
haubna
Newbie
*
Posts: 1


« on: June 21, 2012, 06:22:08 »

Hey guys,

I got a little problem with my vertex shader:

Code:
#version 150

uniform mat4 bones[128]; // inverse bone bind matrices multiplied with the interpolated bone matrices
uniform mat4 bsm; // bind shape matrix
attribute vec4 weights;
attribute vec4 indices;

void main()
{
vec4 v = gl_Vertex;
vec4 finalVertex = vec4(0.0);

int index1 = int(indices.x);
finalVertex = bones[index1] * v; // right here... if i use bones[1] instead of bones[index1] it works fine :o (i am 100% sure that index1 == 1)

gl_FrontColor = weights;
gl_Position = gl_ModelViewProjectionMatrix * finalVertex;
}

Someone knows why this happens?

EDIT:
 - I read about that dynamic indexing isn't working on lower GLSL versions. Any workarounds?
 - This error only exists on an ATI graphics card. On my NVIDIA GC everything works fine.

SOLVED:
 - I exceeded the maximum usable uniforms and thus had to reduce the mat4 bones[128] to mat4[50]. I think i'll use quaternions in the future Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!