pouët.net

Inaccuracies strolling along a ray in GLSL. -.-'

category: code [glöplog]
Oh and ofc for comparison,
this is the image I get when I only run the first part.

Code: rb = rd * (0.07/length(vec3(q,1.0))); while (s < 0.03) { rs += rb; s = snoise(rs); }


BB Image

The 0.0fps are wrong, it's at 50+.
added on the 2015-08-22 18:32:17 by Solecist Solecist
0.0'
added on the 2015-08-22 18:45:09 by panic panic
Quote:
0.0'


What did I do? D:
added on the 2015-08-22 18:47:42 by Solecist Solecist
Quote:
The 0.0fps are wrong, it's at 50+.
added on the 2015-08-22 19:08:13 by panic panic
LOL! :D
oh my ... :)
added on the 2015-08-22 19:22:58 by Solecist Solecist
Hm .... well ...

I managed to raise the fps a bit more,
while going up to 1920x1080,
while faking some AA into it ....

BB Image

This is the full screen version: http://i.imgur.com/IzSoj3P.png

Yeah I know, it looks blurry ... but it's over twice as fast than it was before.
added on the 2015-08-23 11:47:49 by Solecist Solecist
Quote:
What you actually do is raymarching a density field... why not just do it the hacky way and adjust your stepsize to the density? Fiddle with magic constants and some clamping until your scene looks right.

If in doubt, add lot's of noise 2D layers with boom boom soundtrack over it to hide any artifacts... hehehe.


I've managed to do this!
Thank you for the suggestion!
It popped into my mind some time ago and I fiddled around.

Code:vec3 worldZ = (p3d_ModelMatrix * vec4(worldZ,1)).xyz; vec3 ro = vec3(worldZ.x,worldZ.y,worldZ.z); // Ray Origin. vec3 Forward = normalize((worldZ.xyz - worldCoord.xyz).xyz); vec3 OneHalf = Forward*0.5; vec3 One10th = Forward*0.1;//Forward * (0.1/length(Forward)); for(i = 0; i < 200; i++) { t = 0.1-s; rs += (2*t)*One10th; s = snoise(rs); if (s > 0.09) break; } rs -= One10th;


I believe I'm doing what you're saying and it works like a charm!

BB Image

There's quite a few things about this! :D

Like increasing the accuracy, (s > 0.09999), allows me to use the amount of steps for shading!

BB Image

And AntiAliasing! SSAO! But I derail myself ...


I can render this at half the resolution and blow it up using hardware bilinear filtering. Except for the edges it looks the same,
because it's all so smoothly shaded! But simply using the steps themselves to antialias the edges won't work well on 800x500.
So I've been learning about dFdx/y ...

BB Image

... and wow, depth edge detection is SO easy! I render at lower resolution to a texture and use LOD in the next pass!
Or do it in the first pass!



Thank you all, I couldn't do this without you! :D
added on the 2015-10-10 16:27:22 by Solecist Solecist
Solecist: very nice results!
added on the 2015-10-11 01:18:24 by tomkh tomkh
Quote:
Solecist: very nice results!
Thank you! :D

Still working on it! :D
added on the 2015-10-12 11:04:23 by Solecist Solecist

login