Oh mighty gurus of the shader world!!! Lend me you brains for a moment.
I'm just starting out using shaders, so thought I'd make a go of it using HLSL (at least I can understand that LOL... the assembly was killing me). So here's the problem...
I've created a basic shader that should transform the object into proper world/view space and then use flat red coloring. This is intended to be the basis for future procedural shaders to come, so it's pretty simple. What's happening is that the object is projecting correctly, but the color is a solid black... I'm assuming that my output for the pixel color is wrong, but I'm not sure where I messed up. (For the record, I checked the fog. Fog is disabled - I actually saw the effect of fog with this shader... not pretty LOL.)
Code:
material mat_basic_shader
{
effect = "
float4x4 matWorldViewProj;
struct VS_OUTPUT
{
float4 Position : POSITION;
};
VS_OUTPUT vs_main( float4 pos: POSITION )
{
VS_OUTPUT Output;
Output.Position = mul( pos, matWorldViewProj );
return( Output );
}
float4 ps_main() : COLOR0
{
return( float4( 1.0f, 0.0f, 0.0f, 1.0f ) );
}
technique primary
{
pass p0
{
VertexShader = compile vs_2_0 vs_main();
PixelShader = compile ps_2_0 ps_main();
}
}
";
}
action basic_obj
{
wait(1);
my.material = mat_basic_shader;
}
Anyone know how to get what I'm after? I'm at a bit of a loss to see what I missed.
Thanks