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 8928699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:30:17+00:00 2026-06-15T08:30:17+00:00

According to this nVidia CG tutorial (and my own experience) accessing uniform arrays in

  • 0

According to this nVidia CG tutorial (and my own experience) accessing uniform arrays in CG shaders with a non-constant index is either inefficient or unsupported (more often than not, unsupported it seems).

My question is; how can I circumvent this problem?

I am currently writing a GPU skinning shader in which I pass an array of bones (4×4 matrices), which I need to access using an index stored in a vertex attribute (specifically, a float4 vector who’s components are cast to ints). Obviously, because of the limitations mentioned above, this doesn’t work…perhaps I’m missing a better method of doing this?

  • 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-15T08:30:18+00:00Added an answer on June 15, 2026 at 8:30 am

    That is indeed the common way of doing it, e.g. (this is HLSL but essentially the same — note the global uniform ‘boneArray’)

    float4x3 CalcBoneTransform(float4 blendWeights, float4 boneIndices)
    {
      // Calculate normalized fourth bone weight2
      float4 weights = float4(blendWeights.x, blendWeights.y, blendWeights.z , 1.0f - blendWeights.x - blendWeights.y - blendWeights.z);
      // Calculate bone transform
      float4x3 boneTransform;
      int4 indices = boneIndices;
      boneTransform =  weights.x * boneArray[indices.x];
      boneTransform += weights.y * boneArray[indices.y];
      boneTransform += weights.z * boneArray[indices.z];
      boneTransform += weights.w * boneArray[indices.w];
      return boneTransform;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to this answer I want to create my own subclass of Array QArray
According to NVIDIA, this is the fastest sum reduction kernel: template <unsigned int blockSize>
I have trying to install nhibernate according this tutorial, but it doesn't say where
According to this tutorial , the DatePicker control is definitely present in the Javascript
According to this tutorial , calling Class.forName isn't needed anymore with JDBC 4.0+ drivers.
I want to use maven integrated with eclipse to develop webapp according this tutorial:
According to this page http://en.wikipedia.org/wiki/RSA_numbers each RSA version uses one single constant long number
According to this answer , the intended way to include non-header-only parts of Boost
According this article , generic JPA DAO(Data Access Object) is a pretty nice pattern.
I didnt find anything according this issue. Can jaas be used to secure my

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.