Original Post
hello everyone, I'm a rookie on shaders and I'm trying to implement one I got from the post-processing sample. Ok I deleted the things I did not think were important but even with the things I deleted I get a fail on the Effect->ValidateTechnique(hTech) here is the fx file now I don't know why I get a fail on the validation. any clues? thanks
//-----------------------------------------------------------------------------
// File: PP_ColorMonochrome.fx
//
// Desc: Effect file for image post-processing sample. This effect contains
// a single technique with a pixel shader that converts colored image to
// black & white by performing post-processing on a texture.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
texture g_txSrcColor;
sampler2D g_samSrcColor =
sampler_state
{
Texture = <g_txSrcColor>;
AddressU = Clamp;
AddressV = Clamp;
MinFilter = Point;
MagFilter = Linear;
MipFilter = Linear;
};
//-----------------------------------------------------------------------------
// Pixel Shader: PostProcessPS
// Desc: Performs post-processing effect that converts a colored image to
// black and white.
//-----------------------------------------------------------------------------
float3 LuminanceConv = { 0.2125f, 0.7154f, 0.0721f };
float4 PostProcessPS ( float2 Tex : TEXCOORD0 ) : COLOR0
{
return dot( (float3)tex2D( g_samSrcColor, Tex ), LuminanceConv );
}
//-----------------------------------------------------------------------------
// Technique: PostProcess
// Desc: Performs post-processing effect that converts a colored image to
// black and white.
//-----------------------------------------------------------------------------
technique ColorMC
{
pass p0
{
VertexShader = null;
PixelShader = compile ps_2_0 PostProcessPS();
//ZEnable = true;
}
}