So hi guys,
right now I'm just trying to pass a value to the hlsl shader. Now heres the constant buffer in the shader:
cbuffer ConstantBuffer
{
float4x4 final;
float4x4 rotation; // the rotation matrix
float4 lightvec; // the light's vector
float4 lightcol; // the light's color
float4 ambientcol; // the ambient light's color
float3 SPACE;
float alpha; // <-- Variable trying to recieve, the first 5 works!
}
And in c++:
struct CBUFFER
{
public:
D3DXMATRIX Final;
D3DXMATRIX Rotation;
D3DXVECTOR4 LightVector;
D3DXCOLOR LightColor;
D3DXCOLOR AmbientColor;
D3DXVECTOR3 SPACE;
float Alpha;
};
So I've tried to align the variables to be able to send them in packs of 16 bits. But for some reason, it isn't working, because the variable alpha in the shader isn't set.
So what did i do wrong? (PS. I set the bufferwidth in the initialization of the shader to: 192)
Thank You