Jump to content

  • Log In with Google      Sign In   
  • Create Account

csirke128

Member Since 21 Oct 2012
Offline Last Active Nov 10 2012 03:19 PM

Posts I've Made

In Topic: SMAA Implementation - Weights Pass

21 October 2012 - 05:39 PM

Hi,

I've been working on a small 2d drawing app, and i wanted to implement SMAA for it, but i've ran into problems at the 2nd pass, instead of having nice connected lines, i had a lot of dotted lines, and nothing i did in the shaders/c++ code could change it, so i looked around in the SMAA.h and noticed some commented lines:

float SMAASearchLength(SMAATexture2D searchTex, float2 e, float bias, float scale) {
	// Not required if searchTex accesses are set to point:
	// float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);
	// e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +
	//	 e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;
	e.r = bias + e.r * scale;
	return 255.0 * SMAASampleLevelZeroPoint(searchTex, e).r;
}

And after i've changed it to this,

float SMAASearchLength(SMAATexture2D searchTex, float2 e, float bias, float scale) {
	// Not required if searchTex accesses are set to point:
	float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);
	e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +
		e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;
	//e.r = bias + e.r * scale;
	return 255.0 * SMAASampleLevelZeroPoint(searchTex, e).r;
}

everything worked fine

for comparison:

Before
Attached File  smaa1.PNG   11.82KB   33 downloads
After
Attached File  smaa2.PNG   16.17KB   29 downloads

It might not be the same problem, but i think its worth checking it out

(I was using directX11 on windows8, no techinques/effects just pixel and vertex shader)

PARTNERS