pouët.net

Go to bottom

Raymarching Beginners' Thread

category: code [glöplog]
\o/
added on the 2011-08-20 11:40:10 by psykon psykon
Torus: That was why I made the bounding sphere visualization ORANGE.
Fixed it - white now - use your imagination to figure out what it looked like before.
added on the 2011-08-20 11:50:39 by las las
Will it improve effect if I replace cubes with metaballs or better yet <insert your favorite super spectacular super shape here>?

p.s. Probably boobs.
added on the 2011-08-22 17:41:56 by a13X_B a13X_B
metaballs in metaballs! try that!!!
added on the 2011-08-22 18:37:26 by las las
xD i loled! :D FRACTAL METABALLS!!! YES!! now THAT's what the world needs. gonna try!
added on the 2011-08-22 19:32:11 by nystep nystep
That is a dirty little thing las. Would look nice with some of the shading that you applied to your spike-ball, I think?
shadertoy friendly version of nautilus 1k, optimised and unreadable ...

Code: precision lowp float; uniform vec2 resolution; uniform float time; float r=time/3.,i,ii; float e(vec3 c) { c = cos(vec3(cos(c.r+r/6.)*c.r-cos(c.g+r/5.)*c.g,c.b/3.*c.r-cos(r/7.)*c.g,c.r+c.g+c.b+r)); return dot(c*c,vec3(1.))-1.0; } void main() { vec2 c=-1.+2.0*gl_FragCoord.rg/resolution.xy; vec3 o,g=vec3(c.r,c.g,1)/64.; vec4 v; for(float i=1.;i<666.;i+=1.0) { vec3 vct = o+g*i; float scn = e(vct); if(scn<.4) { vec3 r=vec3(.15,0.,0.),c=r; c.r=scn-e(vec3(vct+r.rgg)); c.g=scn-e(vec3(vct+r.grg)); c.b=scn-e(vec3(vct+r.ggr)); v+=dot(vec3(0.,0.,-1.0),c)+dot(vec3(0.0,-0.5,0.5),c); break; } ii=i; } gl_FragColor=v+vec4(.1+cos(r/14.)/9.,0.1,.1-cos(r/3.)/19.,1.)*(ii/44.); }
it doesn't seem to work :( (chrome 13) the current one in shadertoy does, though. i starting to seriously hate all this glsl/browser incompatibilities, what a pain in the ass.
added on the 2011-08-26 07:42:43 by iq iq
Anyone know how to get the distance function for a Tesseract or another 4d object? Shouldn't be to hard to do? Would be really interesting I think :)
added on the 2011-08-27 09:31:04 by Mewler Mewler
n-dim hypersphere is easy ;)
added on the 2011-08-27 12:22:42 by las las
mewler: isn't the tesseract is just the unit cube in R^4? just use the normal formula for a cube, with 4- instead of 3-vectors.
added on the 2011-08-27 13:39:21 by Hyde Hyde
@iq: it works in firefox :(
oops, i accidentally your post number 1337 of the thread.
added on the 2011-08-27 19:27:11 by nystep nystep
increasing the iteration count in some raymarched recursive sierpinski-distributed spheres:

BB Image
added on the 2011-08-27 22:32:38 by iq iq
iq: just a silly question about Nautilus issue.
What kind of values does mouse take at first launch? should we have to correct them down to scale?
uniform vec4 mosue
{resolution.x/0.5,resoluction.y/0.5,0.0,0.0} is that?

it's just guessing, and about to test it on the same machine over a native c++/opengl interaction.
added on the 2011-08-30 12:00:50 by JaK JaK
U right!
vec4 mouse=vec4(V1,V2,V3,V4);
where are : 0.1<=V1,V2,V3,V4<=255.0
it works in opengl/c++

definately should be some Chrome random-blacklisting stuff...one day you have the next don't work...that's because I don't like to update browser too often.
added on the 2011-08-30 13:08:17 by JaK JaK
nystep: how's those fractal-balls going?
added on the 2011-08-30 14:59:14 by rudi rudi
couldnt you just use the 'iteration count' as the energy value, and see how it looks. i bet it would look like a fractal blob with more connections on the floor, if the highest iteration value are closest to the floor...
added on the 2011-08-30 15:03:02 by rudi rudi
or you couldt use the distance from the 'center of the object' to the center of each cube as the energy value for each blob. would look like a big blob with 'lower energy blobs' around it..
added on the 2011-08-30 15:06:21 by rudi rudi
"each cube" = each blob
added on the 2011-08-30 15:07:15 by rudi rudi
Nice :)
added on the 2011-09-11 14:54:34 by las las
1k for win!
added on the 2011-09-11 14:58:10 by rudi rudi
pretty cool!
added on the 2011-09-11 17:56:55 by iq iq
first two lacked motion, third was refreshing :)
added on the 2011-09-11 19:41:28 by ferris ferris

login

Go to top