I am reorganizing the vertex structure in my graphics engine to allow bone animation.
The problem is that I have packed both normals and selection in "NORMAL" by giving xyz to the normal and w to selection but I don't want the users to rewrite their shaders.
These macros are working for most shaders but not the ones that are already accessing specific elements of the normal.
HLSL:
#define Normal NormalAndSelected.xyz
#define Selected NormalAndSelected.w
How do I define 2 variables on the same registry in VS_structure?
If I go around the user too much, making a mistake and getting reports from the HLSL compiler will make no sense. Even the macros can cause confusion when the compiler is quoting something that does not exist in the shader.
I misunderstood, I thought the errors would come from my example. I understand the macros will not work that way. Macros usually ruin the error messages aswell. You could surround the macro values with parantheses. I was only suggesting a solution without macros, a one which I've implemented few times.
Can you say who are these users which you're talking about?
I misunderstood, I thought the errors would come from my example. I understand the macros will not work that way. Macros usually ruin the error messages aswell. You could surround the macro values with parantheses. I was only suggesting a solution without macros, a one which I've implemented few times.
Can you say who are these users which you're talking about?
The engine is mostly used from Visual Basic and I try to keep it simple for beginners.
The best solution would be to find another constant register name. It would be weird if there was only 7 names since that is not a power of 2.