pouët.net

Go to bottom

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.
added on the 2011-06-27 11:47:35 by xernobyl xernobyl
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.

added on the 2011-06-27 11:56:54 by smash smash
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.
added on the 2011-06-27 12:06:20 by las las
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.
added on the 2011-06-27 12:23:23 by kb_ kb_
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.)
added on the 2011-06-27 12:42:08 by psonice psonice
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.
BB Image

added on the 2011-06-27 14:35:25 by las las
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.
added on the 2011-06-27 22:09:44 by T21 T21
...I have yet to learn to read what I write before I submit...
added on the 2011-06-27 22:11:42 by T21 T21
BTW there can be sharp blur artifacts if you're using box / lens blur, instead of gaussian.
added on the 2011-06-27 22:47:40 by xernobyl xernobyl
xernobyl: I use something "different" (blur along the x axis):
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.
added on the 2011-06-28 00:31:35 by las las
las: you should probably apply the FXAA3 shader before post-processing (including the blur, that is).
added on the 2011-06-28 00:50:07 by kusma kusma
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.
added on the 2011-06-28 01:05:52 by xernobyl xernobyl
kusma: unless he wants an hdr blur :P
added on the 2011-06-28 01:08:39 by xernobyl xernobyl
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)
added on the 2011-06-28 01:11:04 by kb_ kb_
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
BB Image
(And I played with some of those constants... That might have screwed up something *cough*)
added on the 2011-06-28 01:20:46 by las las
BB Image
OK? ;)
added on the 2011-06-28 01:26:48 by las las
damn, son.
added on the 2011-06-28 01:38:31 by ferris ferris
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.
added on the 2011-06-28 03:54:48 by smash smash
130 FPS @ HD720.
added on the 2011-06-28 05:39:38 by las las
150. Time to sleep ;)
added on the 2011-06-28 06:04:48 by las las
@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?
added on the 2011-06-28 06:46:18 by Mewler Mewler
Looks damn great.
added on the 2011-06-28 10:04:40 by raer raer
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 ;)
added on the 2011-06-28 12:20:13 by psonice psonice
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.
added on the 2011-06-28 13:42:33 by las las

login

Go to top