Default pass in technique 'XXX' does not define a vertex shader

Apr 24, 2011 at 5:45 PM
Edited Apr 25, 2011 at 11:11 AM

Well i am only started to learn HLGL, so i dont know much in writing a shaders. The shader for the black outlines i have gives me the error: "Default pass in technique 'EdgeDetect' does not define a vertex shader" when compilled by XenFX (with defoult shader applying way it work as intended). When i tryed to write the VertexShaderFunction() i get new error that my function dont passes TEXCOORD0 to the PixelShaderFunction().

So in short, can someone help me write a vertex shader function that does nothing but passes TEXCOORD0 to the pixel shader, or say me how to compile the shader into the shader.fx.cs

the code of shader is here (its from tutorial how to make cell shadeing for XNA):

 

float edgeWidth = 1;
float edgeIntensity = 1;
float normalSensitivity = 1;
float depthSensitivity = 10;
float normalThreshold = 0.5;
float depthThreshold = 0.1;
float2 screenResolution;
texture sceneTexture;

sampler SceneSampler : register(s0) = sampler_state { Texture = (sceneTexture); MinFilter = Linear; MagFilter = Linear; AddressU = Clamp; AddressV = Clamp; }; texture normalDepthTexture;
sampler NormalDepthSampler : register(s1) = sampler_state { Texture = (normalDepthTexture); MinFilter = Linear; MagFilter = Linear; AddressU = Clamp; AddressV = Clamp; }; float4 PixelShaderFunction(float2 texCoord : TEXCOORD0) : COLOR0 { float3 scene = tex2D(SceneSampler, texCoord); float2 edgeOffset = edgeWidth / screenResolution; float4 n1 = tex2D(NormalDepthSampler, texCoord + float2(-1, -1) * edgeOffset); float4 n2 = tex2D(NormalDepthSampler, texCoord + float2( 1, 1) * edgeOffset); float4 n3 = tex2D(NormalDepthSampler, texCoord + float2(-1, 1) * edgeOffset); float4 n4 = tex2D(NormalDepthSampler, texCoord + float2( 1, -1) * edgeOffset); float4 diagonalDelta = abs(n1 - n2) + abs(n3 - n4); float normalDelta = dot(diagonalDelta.xyz, 1); float depthDelta = diagonalDelta.w; normalDelta = saturate((normalDelta - normalThreshold) * normalSensitivity); depthDelta = saturate((depthDelta - depthThreshold) * depthSensitivity); float edgeAmount = saturate(normalDelta + depthDelta) * edgeIntensity; scene *= (1 - edgeAmount); return float4(scene, 1); } technique EdgeDetect { pass P0 { PixelShader = compile ps_2_0 PixelShaderFunction(); } }

Nevermind, i wrote that one myself. Head is working alot better now, not when i dont slept for 24 hours >.<