I'm trying to make a shader which modifies a colour in the VertexShader. To do this, I want access to a vertexes diffuse/specular or whatever colour. I'm not too fussed, so long as I can access a colour value. Anyone know how to do this?
What I have so far:
My VertexShader in structure looks like this:
struct IN_Normal
{
float3 Pos:POSITION;
float2 uv:TEXCOORD0;
float4 Blendweight:TEXCOORD1;
float4 Blendindices:TEXCOORD2;
float4 Normal:NORMAL;
float4 Diffuse:COLOR1;
};
For the value Diffuse I have tried COLOR, COLOR0 and COLOR1 in combination with the following modifications in my program code:
SetObjectDiffuse()
SetObjectSpecular()
ConvertObjectFVF() <- To ensure it has specular/diffuse values
Lock model, loop through all vertices and SetVertexDataDiffuse() to a colour.
In all these combinations, I only get black (0) into the diffuse variable. The documentation for vertexshader semantics says COLOR/0/1 specifically refer to DIFFUSE and SPECULAR. So does anyone know how to get those values passed into my vertexshader?
The actual problem I'm trying to solve is, I want to set an overall brightness for my model, but I want to do it on a per model basis. So I can't pass in a constant(tweakable) diffuse, as this would apply to all models using this effect. I want to be able to set each overall brightness for each model individually, and using the diffuse/specular colours makes the most sense, but I just can't figure out how to access it.
Any clue?!