HLSL: Index to unaligned/packed floats

后端 未结 1 616
北荒
北荒 2021-01-24 04:38

I have a vertex shader (2.0) doing some instancing - each vertex specifies an index into an array.

If I have an array like this:

float instanceData[100];         


        
相关标签:
1条回答
  • 2021-01-24 05:12

    Does that helps?:

    float4 packedInstanceData[25];
    ...
    float data = packedInstanceData[index / 4][index % 4];
    
    0 讨论(0)
提交回复
热议问题