Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7776839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:58:48+00:00 2026-06-01T17:58:48+00:00

I have already lost 2 days trying to figure out on this issue, but

  • 0

I have already lost 2 days trying to figure out on this issue, but with no use.

I have written a collada animation renderer using opengles2.0 for android; using shader for skinning. The code is almost complete and it runs just fine on my HTC DesireS.

But, when I try to run the same on a tridernt SetTopBox with PowerVR chipset, my geometry is not displayed. After a day of debugging, I found out that it is happening because I am getting != -1 as bone matrix indeices in the shader.

I verified that it is == -1 in my phone; but is != -1 in the SetTopBox.

What could possibly be wrong?
Please save me from this big trouble.

Sorry for not puttingup the code.
Here is the vertex shader. I am expecting vec2(boneIndices) to have -1 in [0] as well as [1]; but is not so on Powervr.

attribute vec4 vPosition;
attribute vec2 vTexCoord;
attribute vec2 boneIndices;
attribute vec2 boneWeights;

uniform mat4 boneMatrices[BNCNT];

uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;

varying mediump vec2 fTexCoord;
varying mediump vec3 col;

void main(){
    vec4 tempPosition = vPosition;
    int index = int(boneIndices.x);
    col = vec3(1.0, 0.0, 0.0);
    if(index >= 0){
        col.y = 1.0;
        tempPosition = (boneMatrices[index] * vPosition) * boneWeights.x;
    }
    index = int(boneIndices.y);
    if(index >= 0){
        col.z = 1.0;
        tempPosition = (boneMatrices[index] * vPosition) * boneWeights.y + tempPosition;
    }
    gl_Position = projectionMatrix * viewMatrix * modelMatrix * tempPosition;

    fTexCoord = vTexCoord;
}

setting up the attribute pointers

glVertexAttribPointer(position, 3, GL_FLOAT, GL_FALSE, 13*sizeof(GLfloat), 0);
glVertexAttribPointer(texCoord, 2, GL_FLOAT, GL_FALSE, 13*sizeof(GLfloat), (GLvoid*)(3*sizeof(GLfloat)));
glVertexAttribPointer(boneIndices, 2, GL_FLOAT, GL_FALSE, 13*sizeof(GLfloat), (GLvoid*)(9*sizeof(GLfloat)));
glVertexAttribPointer(boneWeights, 2, GL_FLOAT, GL_FALSE, 13*sizeof(GLfloat), (GLvoid*)(11*sizeof(GLfloat)));
glEnableVertexAttribArray(position);
glEnableVertexAttribArray(texCoord);
glEnableVertexAttribArray(boneIndices);
glEnableVertexAttribArray(boneWeights);

my vertex and index buffers

GLfloat vertices[13*6] =
{-0.5*size, -0.5*size, 0, 0,1, 1,1,1,1, -1,-1, 0,0,                                 
 -0.5*size,  0.5*size, 0, 0,0, 1,1,1,1, -1,-1, 0,0, 
  0.5*size,  0.5*size, 0, 1,0, 1,1,1,1, -1,-1, 0,0, 

 -0.5*size, -0.5*size, 0, 0,1, 1,1,1,1, -1,-1, 0,0, 
  0.5*size,  0.5*size, 0, 1,0, 1,1,1,1, -1,-1, 0,0, 
0.5*size, -0.5*size, 0, 1,1, 1,1,1,1, -1,-1, 0,0 };

GLushort indices[]= {0,1,2, 3,4,5}; 

I am expecting the indices to be -1 in the shader; but they are not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:58:49+00:00Added an answer on June 1, 2026 at 5:58 pm

    After days of frustration, I finally found the problem by myself.

    The culprit was the “int()” function call, which was returning 0 even if I specify -1.
    The observed behavior is that it returns
    0 for -1
    -1 for -2
    -2 for -3 and like…

    I am not sure if this is a driver/hw bug, or if it is because of the floating point representation where -1 is represented as something like “-.9999999”

    Can anybody shed a little more light on this?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already download and install this package to support HTML5 input type http://support.microsoft.com/kb/2468871
I have already googled and searched stackoverflow but I can find nothing related to
I have already read some posts, but no one helped me with my problem.
for the past four days I am trying to understand the dijkstra's algorithm. But
I have read many posts about this now but I do not still understand
So i have been stuck trying to learn this Scheme language that i heard
I have searched lot for this answer but there is no near answer for
This is kind of I already lost x hours debugging this kind of problem/question
Anyone know about this? I am trying to embed that plugin and am lost.
I lost my temper few days ago because of this simple problem. Can you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.