When using instancing, is it possible to send a single float to a vertex shader like this ?
C++
struct InstanceData
{
XMFLOAT4X4 World;
float IsSelected;
};
HLSL
struct VertexIn
{
float3 PosL : POSITION;
float3 NormalL : NORMAL;
float2 Tex : TEXCOORD0;
float isSelected : DEPTH; // Instance data
row_major float4x4 World : WORLD; // Instance data
};
I tried but it did not work, the only way i can have it working now is to put use something like TEXTCOORD1 and put my float in one of the two component, i thought DEPTH would be more appropriate as it seems to be just for a single float, but it does not seem to work with instancing.
So i guess my question is what is the most efficient way to send to each instance a single float ?
Thanks !






