Original Post
I have read the SDK and use ConstantTable->SetFloatArray(.....) to insert the array of floats. Here is the snippet of the code
float Ambient[] = {1.0, 1.0, 1.0, 1.0};
ConstantTable->SetFloatArray(gD3DDevice, "Ambient", Ambient, 4);
Here is the vertex shader
struct VS_INPUT
{
float4 Position : POSITION0;
float4 Normal : NORMAL;
float4 Color : COLOR0;
float2 Texture : TEXCOORD0;
};
struct VS_OUTPUT
{
float4 Position : POSITION0;
float4 Color : COLOR0;
float2 Texture : TEXCOORD0;
};
float4x4 WorldViewProj;
float4 Ambient;
VS_OUTPUT vs_main( in VS_INPUT In )
{
VS_OUTPUT Out;
Out.Position = mul(In.Position, WorldViewProj);
Out.Color = In.Color * Ambient;
Out.Texture = In.Texture;
return Out;
}
However the square that i render is forever black, no texture or anything, it is just black. How should i go about solving the problem?