Hi FriendlyFire. I'm sorry for the late answer, I'm in total crunch time and deadlines do not forgive !
I eventually got SMAA to work on console aaaannnnnd it took 10 ms to render ! This is the time I gave up.
To have it working on PC, I simply turned the pixel shader interpolated array "offsets[3]" into 3 interpolated values "offset0", "offset1" and "offset2". The compiler did mess with them.
Hey! First of all thanks for updating this.
I've tried to do as you said, but I do not see any significant change. I have tried to only replace the offset array in SMAABlendingWeightCalculationPS and to replace all offset arrays in all functions to no avail.
If you have a few moments, would you be able to detail a bit more what you've done to fix it, perhaps with some code?
Here's the code I'm using to integrate the SMAA in our engine shader generator.
The #define ENABLE_SMAA_VS is set only when compiling a vertex shader. The DX9 compiler was messing things up otherwise (as well as our GLSL converter).
Thanks for the help. I've been trying things following your post but I just can't seem to figure it out. Guess I'll put it on the backburner for a while longer...
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
[attachment=11856:smaa1.PNG]
After
[attachment=11857:smaa2.PNG]
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)