@ shadeMe: I can't spot anything, sorry. What's the full code though?
@ Malonn: Well, if Scanti sets that backwards compatibility flag that lets the half variable be used, then yes, otherwise if a shader contains them, they'll have to be replaced by floats. I have no idea why halfs were used anyway, it's not like they go phased out since the shaders were written, it happened ages ago.
texture lastpass;texture thisframe;texture Depth;sampler smpThisFrame = sampler_state{texture = ; AddressU = CLAMP; AddressV = CLAMP; MINFILTER = LINEAR; MAGFILTER = LINEAR;};sampler smpLastPass = sampler_state{texture = ; AddressU = CLAMP; AddressV = CLAMP; MINFILTER = LINEAR; MAGFILTER = LINEAR;};sampler smpDepth = sampler_state{texture = ; AddressU = CLAMP; AddressV = CLAMP; MINFILTER = LINEAR; MAGFILTER = LINEAR;};float rcpres[2];const static float edgeStrength = 15.f; // increase for stronger edgesconst static bool flgEdgeMask = 0; // show depth mask. Must be set to 0 before enabling edgeAAconst static bool flgEdgeAA = 0; // enable edgeAAconst static float edgeAABlurAmt = 0.04; // edge blur magnitudeconst static bool flgUseWillowGameData = http://forums.bethsoft.com/index.php?/topic/1076282-oblivion-graphics-extender-thread-10/0; // set to 1 to make the edges more Borderlands-ish.const static float2 gBlurKernel[8] ={ { -4, 0 }, { -3, 0 }, { -2, 0 }, { -1, 0 }, { 1, 0 }, { 2, 0 }, { 3, 0 }, { 4, 0 },};const static float gBlurWeights[8] = { 0.002216, 0.008764, 0.026995, 0.064759, 0.064759, 0.026995, 0.008764, 0.002216,};const static int sizeKernelWG = 8;const float2 blurCoordWG[sizeKernelWG] = { { -2.0, 0.0}, { 2.0, 0.0}, { -2.0, 2.0}, {-2.0, -2.0}, { 2.0, 2.0}, { 2.0, -2.0}, { 0.0, 2.0}, {-0.0, -2.0},};const float blurMagnitudeWG[sizeKernelWG] = { {1.0}, {1.0}, {1.0}, {1.0}, {0.9}, {0.9}, {0.8}, {0.8},}; const static int sizeKernel = 12;const float2 blurCoord[sizeKernel] = { { 1.0,-1.0}, { 1.0, 1.0}, { -1.0, -1.0}, {-1.0, 1.0}, { 0.0,-2.0}, { 2.0, 0.0}, { 0.0, 2.0}, {-2.0, 0.0}, { 2.0,-2.0}, { 2.0, 2.0}, { -2.0, -2.0}, {-2.0, 2.0},};const float blurMagnitude[sizeKernel] = { {1.0}, {1.0}, {0.95}, {0.95}, {0.85}, {0.85}, {0.8}, {0.8}, {0.70}, {0.70}, {0.65}, {0.65},};struct VSOUT{ float4 vertPos : POSITION; float2 UVCoord : TEXCOORD0;};struct VSIN{ float4 vertPos : POSITION0; float2 UVCoord : TEXCOORD0;};VSOUT FrameVS(VSIN IN){ VSOUT OUT = (VSOUT)0.0f; OUT.vertPos = IN.vertPos; OUT.UVCoord = IN.UVCoord; return OUT;}float4 getDepth(float2 UVCoord){ float4 colDepth = tex2D(smpDepth, UVCoord); colDepth = pow(colDepth,17); return colDepth;}half4 gBlurify(float2 UVCoord, half blurAmt, int4 blurDir){ half4 colOutput = 0.f; half2 dirMod1 = 0.f; half2 dirMod2 = 0.f; for (int i = 0; i < 8; i++) { dirMod1 = gBlurKernel[i].yx; if (dirMod1.y> 0) dirMod1.y *= blurDir[2]; if (dirMod1.y < 0) dirMod1.y *= blurDir[3]; colOutput += tex2D(smpThisFrame, UVCoord + (gBlurKernel[i].yx * blurAmt) * gBlurWeights[i]); dirMod2 = gBlurKernel[i].xy; if (dirMod2.x > 0) dirMod2.x *= blurDir[0]; if (dirMod2.x < 0) dirMod2.x *= blurDir[1]; colOutput += tex2D(smpThisFrame, UVCoord + (gBlurKernel[i].xy * blurAmt) * gBlurWeights[i]); } return colOutput / 16;}half4 edgeFilter(VSOUT IN) : COLOR0{ half4 colEdge = 0.f, colOutput = 0.f, colInput = getDepth(IN.UVCoord); for (int i = 0; i < (flgUseWillowGameData ? sizeKernelWG : sizeKernel); i++) { colOutput = getDepth(IN.UVCoord + (flgUseWillowGameData ? blurCoordWG[i] : blurCoord[i]) * float2(rcpres[0], rcpres[1])); colEdge += saturate(colOutput.r * (flgUseWillowGameData ? blurMagnitudeWG[i] : blurMagnitude[i]) - colInput.r) * edgeStrength; colEdge += saturate(colOutput.g * (flgUseWillowGameData ? blurMagnitudeWG[i] : blurMagnitude[i]) - colInput.g) * edgeStrength; colEdge += saturate(colOutput.b * (flgUseWillowGameData ? blurMagnitudeWG[i] : blurMagnitude[i]) - colInput.B) * edgeStrength; } colOutput = 1 - colEdge; if (flgEdgeMask) colOutput = 1 - colOutput; return colOutput;}half4 edgeAA(VSOUT IN) : COLOR0{ half4 colEdge = tex2D(smpLastPass, IN.UVCoord); half4 colOutput = tex2D(smpThisFrame, IN.UVCoord); half depCenter = getDepth(IN.UVCoord).x; if (flgEdgeAA) { if (dot(colEdge.xyz, 1) == 0) { half4 dirDepth; dirDepth.x = getDepth(IN.UVCoord + half2(-1,0) * half2(rcpres[0], rcpres[1])).x; dirDepth.y = getDepth(IN.UVCoord + half2(1,0) * half2(rcpres[0], rcpres[1])).x; dirDepth.z = getDepth(IN.UVCoord + half2(0,-1) * half2(rcpres[0], rcpres[1])).x; dirDepth.w = getDepth(IN.UVCoord + half2(0,1) * half2(rcpres[0], rcpres[1])).x; half4 depSamp = half4(depCenter - dirDepth.x, depCenter - dirDepth.y, depCenter - dirDepth.z, depCenter - dirDepth.w); half threshold = 0.016 * depCenter; depSamp.xyzw = (depSamp.xyzw > threshold); depSamp = dot(depSamp, 1); // no apparent difference b'ween selective sampling and full sampling colOutput = gBlurify(IN.UVCoord, edgeAABlurAmt, depSamp); } } else colOutput *= colEdge; return colOutput;}technique t0{ pass p0 { VertexShader = compile vs_1_1 FrameVS(); PixelShader = compile ps_3_0 edgeFilter(); } pass p1 { VertexShader = compile vs_1_1 FrameVS(); PixelShader = compile ps_3_0 edgeAA(); }}
I've been getting such cryptic compile errors lately and they are driving me nuts.