Greg G
Greg G

Reputation: 697

DirectX Color: Why can't it be a float?

In my vertex declaration I can use various data types for color. Including:

I can't however use a float, it causes my shader to get the incorrect value.

I know an float is 4 bytes and so are all the other datatype I listed. So why does a float not work and the others do?

Upvotes: 0

Views: 884

Answers (1)

K-ballo
K-ballo

Reputation: 81349

How would a single float represent the 4 (A,R,G,B) components? If you wonder how int does it, it packs 4 bytes within its 32bit (4 bytes) value.

Upvotes: 4

Related Questions