Quote:Original post by swiftcoder
Last I checked, light had a frequency too
With that usage, the images would be blue-violet hued ;D
In all seriousness, I was just joking around of course
Quote:Original post by swiftcoder
Last I checked, light had a frequency too
Quote:Original post by REF_Cracker
ArKano22:
First off thanks for sharing your method... Now
I'm looking over the code and have a problem with a few things... could you explain the reasoning?
First off I see that vec[8] is initialized to the corners of a cube with the dimensions of (2,2,2). And then you do some pseudo random sampling in those directions. The problem is you are sampling out in 2D so your +1 or -1 in Z of those values never matters. In fact you're only passing the vec2 value of this to your doAmbientOcclusion function anyway. Did I miss something here? Wouldn't you be better off sampling in an 8 way circle if this is the case?
Now for the random length it seems you're sampling a texture with 4 values. That work out to always be one of (1.0,0.72,0.46,0.23) .. is that correct?
Thanks!
Quote:Original post by Prune
I can't really make out any quality difference between this and the earlier approach. Great result!
Quote:
float getRandom(in float2 uv)
{
return ((frac(uv.x * (g_screen_size.x/2.0))*0.25)+(frac(uv.y*(g_screen_size.y/2.0))*0.75));
}
Quote:Original post by martinsh
Awesome, thanks for sharing.
that is some clever blurring.
I ended up using this line instead of texture.Quote:
float getRandom(in float2 uv)
{
return ((frac(uv.x * (g_screen_size.x/2.0))*0.25)+(frac(uv.y*(g_screen_size.y/2.0))*0.75));
}
Looks the same, but you don`t need external random texture and I gained like 2 fps :D
int ringsamples;for (int i = 1; i <= rings; i += 1){ ringsamples = i * samples; for (int j = 0 ; j < ringsamples ; j += 1) { float step = PI*2.0 / float(ringsamples); pw = (cos(float(j)*step)*float(i)); ph = (sin(float(j)*step)*float(i))*aspect; d = readDepth( vec2(texCoord.s+pw*w,texCoord.t+ph*h)); ao += compareDepths(depth,d); s += 1.0; }}