Jo0oker
21-02-2011 14:56:17
Hello,
i tried to use a simple HLSL Shader in a Material:
And here the Material
But if i set the material to an object, it is still white.
Does any one a failure?
Greats,
Jo0oker
i tried to use a simple HLSL Shader in a Material:
//Einfache Kollorierung eines Objetes
//Vertexsahder Ausgabe
struct VS_OUTPUT
{
float4 Position : POSITION;
float4 Diffuse : COLOR0;
float2 TextureUV : TEXCOORD0;
}
VS_OUTPUT RenderColor_vp(float4 vPos : POSITION,
uniform float4x4 cWorldViewProj)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
Output.Position = mul(vPos, uWorldViewProj);
Output.Diffuse = float4(1, 0, 0, 1);
return Output;
}
float4 RenderColor_fp(VS_OUTPUT VertexInput)
{
return VertexInput.Diffuse;
}
And here the Material
vertex_program Color/VP hlsl
{
source Color.hlsl
entry_point RenderColor_vp
target vs_2_0
}
fragment_program Color/FP hlsl
{
source Color.hlsl
entry_point RenderColor_fp
target ps_2_0
}
material SimpleColor
{
technique
{
pass
{
// Vertex program reference
vertex_program_ref Color/VP
{
param_named_auto cWorldViewProj worldviewproj_matrix
}
// Fragment program
fragment_program_ref Color/FP
{
}
}
}
}
But if i set the material to an object, it is still white.
Does any one a failure?
Greats,
Jo0oker