Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualBornToCode

Posted 27 March 2013 - 02:14 PM

The problem i am having is that i have this chunck of code

 

    #ifdef BONE
    mat4 finalmatrix=mat4(0);
    float finalweight=0;
    for(int i=0;i<4;i++)
    {
        int index = int(indicies[i]);
        finalmatrix+=SPARTAN_MATRIX_BONES[index]*weights[i];
        finalweight+=weights[i];
    }
    finalmatrix=finalmatrix/finalweight;
    
    #ifdef POSITION
    aposition = (finalmatrix*vec4(position,1.0f)).xyz;
    #endif
    
    #ifdef NORMAL
    anormal = (finalmatrix*vec4(normal0,0.0f)).xyz;
    #endif
    
    #ifdef TANGENT
    atangent =(finalmatrix*vec4(tangent0,0.0f)).xyz;
    #endif
    #endif

 

which supposed to just do skinning. The problem is that when i pass the entire bone hierachy to SPARTAN_MATRIX_BONE, it is only copying the first index. the function that i am using is glUniform4uiv with a count of numbones. SPARTAN_MATRIX_BONE is defined as an array of 70 mat4. I am so stumped at this point as to why it is not copying the entire thing to the GPU.

 

Another test i also did is that i try calling the glGet function to make sure that was the case. When i copy the data back to my pointer only the first matrix is filled up every other ones in the array were Identity.

 

glGetActiveUniform is returning the proper size. So that is what is even more confusing.

 

At this point i do not know if this is a driver bug i just encountered or what. I am running it on an ATI HD 5800 graphics card.


#1BornToCode

Posted 27 March 2013 - 02:12 PM

The problem i am having is that i have this chunck of code

 

    #ifdef BONE
    mat4 finalmatrix=mat4(0);
    float finalweight=0;
    for(int i=0;i<4;i++)
    {
        int index = int(indicies[i]);
        finalmatrix+=SPARTAN_MATRIX_BONES[index]*weights[i];
        finalweight+=weights[i];
    }
    finalmatrix=finalmatrix/finalweight;
    
    #ifdef POSITION
    aposition = (finalmatrix*vec4(position,1.0f)).xyz;
    #endif
    
    #ifdef NORMAL
    anormal = (finalmatrix*vec4(normal0,0.0f)).xyz;
    #endif
    
    #ifdef TANGENT
    atangent =(finalmatrix*vec4(tangent0,0.0f)).xyz;
    #endif
    #endif

 

which supposed to just do skinning. The problem is that when i pass the entire bone hierachy to SPARTAN_MATRIX_BONE, it is only copying the first index. the function that i am using is glUniform4uiv with a count of numbones. SPARTAN_MATRIX_BONE is defined as an array of 70 mat4. I am so stumped at this point as to why it is not copying the entire thing to the GPU.

 

Another test i also did is that i try calling the glGet function to make sure that was the case. When i copy the data back to my pointer only the first matrix is filled up every other ones in the array were Identity.

 

At this point i do not know if this is a driver bug i just encountered or what. I am running it on an ATI HD 5800 graphics card.


PARTNERS