Raymarching Beginners' Thread
category: code [glöplog]
if fxaa has an early exit then it makes sense to have a blurier image. but it can lead to artifacts. maybe.
kb: all the cool kids on ps3 do their post aa on spu now.. :)
the thing about mlaa is it looks really sharp. ill try give fxaa a go sometime and do a compare, I guess.
the thing about mlaa is it looks really sharp. ill try give fxaa a go sometime and do a compare, I guess.
Lord Graga, simple glow post-proc. The FXAA3 edge detection works still pretty well on the result and I can compute the luma in the last postproc pass. For DOF things might be different. SHARP BLURRING ARTIFACTS. WTF.
smash: Hypes come and go, that's what all the cool kids will eventually learn when they grow up. ;)
Seriously tho, eg. physics heavy games that are mostly SPU bound (I have heard rumours that this can actually happen :) will probably be thankful for being able to offload something simple as this to the GPU instead; 1ms isn't too shabby even for 60fps games. Then again this is the Raymarching Beginners' Thread, not the Pro Game Dev Post-AA Cockfight Thread, so who knows.
Seriously tho, eg. physics heavy games that are mostly SPU bound (I have heard rumours that this can actually happen :) will probably be thankful for being able to offload something simple as this to the GPU instead; 1ms isn't too shabby even for 60fps games. Then again this is the Raymarching Beginners' Thread, not the Pro Game Dev Post-AA Cockfight Thread, so who knows.
Had a quick go at doing this myself, without figuring out how it works first. Ended up looking good on diagonals, but blurry and still stepped horizontal/vertical edges. But it preserved detail away from edges at least :) The key I think is getting the gradient - it's easy on diagonals, but trickier with nearly straight lines.
(And before you get all worked up smash, this is how I like to learn ;) Attempt it without knowledge of how it's normally done, and learn from mistakes. I find that gives a deeper understanding of how things work. Then read the paper, learn from mistakes again and pick up on all the stuff you didn't think of.)
(And before you get all worked up smash, this is how I like to learn ;) Attempt it without knowledge of how it's normally done, and learn from mistakes. I find that gives a deeper understanding of how things work. Then read the paper, learn from mistakes again and pick up on all the stuff you didn't think of.)
Post some God damn screenshots already!
Okay I will break my own rule - given that currently due to the lack of time stuff wont most probably be finished for evoke.
Nothing really stunning.
Pass7 is the post processing combined and Pass8 is the same with FXAA3 PC Quality.
Nothing really stunning.
Pass7 is the post processing combined and Pass8 is the same with FXAA3 PC Quality.
FXAA doesn't look like its doing much in your case...
Have you double checked the 'check list' to get FXAA working,
Like enabling linear filtering on the texture sampler ?
BTW, I like to color & look. (Got an 'emissive' quality)
With no motion it also look like a you have a green sphere inside a frosted glass shell.
Have you double checked the 'check list' to get FXAA working,
Like enabling linear filtering on the texture sampler ?
BTW, I like to color & look. (Got an 'emissive' quality)
With no motion it also look like a you have a green sphere inside a frosted glass shell.
...I have yet to learn to read what I write before I submit...
BTW there can be sharp blur artifacts if you're using box / lens blur, instead of gaussian.
xernobyl: I use something "different" (blur along the x axis):
It's some kind of box filter but with coordinate distortion trying to fake some gaussian like behavior.
Yes, Pass7 and Pass8 are pretty similar - I might have screwed up something (I guess it's still about the pixel centers...)... Using rendermonkey for subpixel exact stuff is kind of painful. Or I screwed up some fxaa parameters... Dunno yet. Will move the stuff to the nasm framework in some days.
Code:
sampler2D t1; // Guess what...
float s; // Blur "strength"
float2 rf; // 1/ViewportDimensions
float4 main(float2 v:texcoord):color {
const float o[9]={8,4,2,1,0,-1,-2,-4,-8};
float4 c=0;
[unroll] for (float i=0;i<9;++i)
c+=tex2Dlod(t1,float4(v+int2(o[i],0)*rf*s,0,0));
return c/9;
}
It's some kind of box filter but with coordinate distortion trying to fake some gaussian like behavior.
Yes, Pass7 and Pass8 are pretty similar - I might have screwed up something (I guess it's still about the pixel centers...)... Using rendermonkey for subpixel exact stuff is kind of painful. Or I screwed up some fxaa parameters... Dunno yet. Will move the stuff to the nasm framework in some days.
las: you should probably apply the FXAA3 shader before post-processing (including the blur, that is).
I copy pasted the shader, used gl_FragCoord.xy and a sampler2DRect and everything looks great, just some 15 minutes of copy pasting... and such.
kusma: unless he wants an hdr blur :P
Also look for the line "float4 rgbyM ..." and insert "return rgbyM;" right after it. If your pixel centers are correct, this should get you the original image back. And when you do sth like "return float4(lumaN,lumaW,lumaS,lumaE);" instead you can test the alpha->luma conversion and the rcpFrame constant - you should get a monochrome image with some convergence error of exactly 1px back.
(adjust the above sentence qccordingly if you use the "downscale by 1.333" technique)
(adjust the above sentence qccordingly if you use the "downscale by 1.333" technique)
Kusma: Shit - you are telling me news!
Actually I checked where the thing gets applied and the edges are correctly detected.
The pixel centers are definitely correct. Just checked it once again.
Now I use the color from pass 0 to generate the luma for the FXAA
(And I played with some of those constants... That might have screwed up something *cough*)
Actually I checked where the thing gets applied and the edges are correctly detected.
The pixel centers are definitely correct. Just checked it once again.
Now I use the color from pass 0 to generate the luma for the FXAA
(And I played with some of those constants... That might have screwed up something *cough*)
OK? ;)
damn, son.
psonice: dont worry, im not going to go crazy at you for trying something out :) (unless you start saying you invented a... etc and didnt try it first) :)
I tried fxaa btw. its great! very fast and good looking, quicker than mlaa altho perhaps a touch more blurry. its great tho, might switch to it here.
I tried fxaa btw. its great! very fast and good looking, quicker than mlaa altho perhaps a touch more blurry. its great tho, might switch to it here.
130 FPS @ HD720.
150. Time to sleep ;)
@las Whoa, what optimizations are you using to run that fast, thats a pretty complicated object. Also, nice! :D
Also also, why are you using 6 blur passes? It looks great but why so many?
Also also, why are you using 6 blur passes? It looks great but why so many?
Looks damn great.
Yep, gorgeous rendering there las!
Smash: I haven't claimed to have invented anything so far as I'm aware, if I came across that way it's probably because I'd figured something out that's novel to me. I don't read much of the literature, and I've not been coding long so I don't know how many of the older effects work, so 'novel to me' covers quite a lot ;)
Smash: I haven't claimed to have invented anything so far as I'm aware, if I came across that way it's probably because I'd figured something out that's novel to me. I don't read much of the literature, and I've not been coding long so I don't know how many of the older effects work, so 'novel to me' covers quite a lot ;)
Thank you :)
Switching from R32G32B32A32F to R16G16B16A16F gave a huge boost - especially for the 3d noise texture. I use separated blur passes for horizontal/vertical blur. All together I blur the whole thing three times (With a rendertarget sized WIDTH/2, HEIGHT/2).
I could use a bigger kernel, but I don't think the results will be as good/fast.
Switching from R32G32B32A32F to R16G16B16A16F gave a huge boost - especially for the 3d noise texture. I use separated blur passes for horizontal/vertical blur. All together I blur the whole thing three times (With a rendertarget sized WIDTH/2, HEIGHT/2).
I could use a bigger kernel, but I don't think the results will be as good/fast.