Hi, I'm trying to do some simple D3D9 rendering.
Problem is, with the shader below, the output on screen is always white even though I'm clearly telling it to return blue
float4x4 gWorld : WORLD;
float4x4 viewProj : VIEWPROJECTION;
// Vertex Shader
float4 vs( float3 pos : POSITION ) : POSITION
{
float4 output;
output = mul( float4( pos.xyz,1 ), gWorld );
output = mul( float4( output.xyz,1 ),viewProj );
return output;
}
// Pixel Shader
float4 ps( float4 pos : POSITION ) : COLOR
{
// Returning blue, but getting white?
return float4( 0,0,1,1 );
}
this problem doesn't occur if I simply add another semantic to the vertex shader input, then it returns whatever color I want.
The object is drawn correctly ( cube in this case ) just the wrong color unless I pass the vertex shader more than just the position.
I'll post c++ code if it's needed.
EDIT:
I actually found it it will only apply the color the way it should ONLY if I pass the color through vertices. Continuing to debug...
EDIT AGAIN:
It seems that the pixel shader isn't even getting called. Any color I return from the vertex shader will be the color used assuming that I have the COLOR semantic on it, and if no color is returned the color is white.
// This is how I load the shader, not sure where to go from here. But I'll google some more
D3D9* d3d = CEngine::getD3D9();
D3DXCreateEffectFromFileA( d3d->getDevice(),"Assets/Shaders/SimpleShader.fx",0,0,0,0,&shader,0 );
