Raymarching Beginners' Thread
category: code [glöplog]
\o/
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.
Fixed it - white now - use your imagination to figure out what it looked like before.
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.
p.s. Probably boobs.
metaballs in metaballs! try that!!!
xD i loled! :D FRACTAL METABALLS!!! YES!! now THAT's what the world needs. gonna try!
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.
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 :)
n-dim hypersphere is easy ;)
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.
@iq: it works in firefox :(
oops, i accidentally your post number 1337 of the thread.
increasing the iteration count in some raymarched recursive sierpinski-distributed spheres:
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.
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.
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.
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.
nystep: how's those fractal-balls going?
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...
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..
"each cube" = each blob
Some stuff I've been working on :)
http://vimeo.com/28851552
http://vimeo.com/28878479
http://vimeo.com/28878571
http://vimeo.com/28851552
http://vimeo.com/28878479
http://vimeo.com/28878571
Nice :)
1k for win!
pretty cool!
first two lacked motion, third was refreshing :)