Dark Bit Factory & Gravity
PROGRAMMING => Coding tutorials => Topic started by: flightcrank on July 19, 2016
-
Hey guys heres a cool metaball tutorial by daniel shiffman who also has other cool tutorials relevant to demoscene coding.
As metaballs are popular in the demoscene i thought id post this one. i hope it helps out people (like me) who has trouble
in written tutorials when they throw to much math at you with not enough explanation behind it.
https://www.youtube.com/watch?v=ccYLb7cLB1I
-
Wow and ha ha. It was really nice, watching his Video. Thanks for sharing.
:goodpost:
-
I found him on youtube yesterday and subscribed (blessed are our all-knowing algorithmic overlords). I followed his reaction diffusion video and wrote it in codea on the ipad (with lua) but it was too slow even with a small bitmap, I need to learn more about GLSL and run it in a shader.
K+ for posting, I was thinking of doing the same thing! :cheers:
-
, I need to learn more about GLSL and run it in a shader.
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
vec2 position;
float addLight (vec2 pos, float size, vec3 c)
{
float tmp =0.2;
float dist = distance(position, pos);
float clmp=clamp(sin(time*1.2)*1.5,0.9,0.3);
tmp += (size / dist) * clmp;
tmp = pow(tmp,4.0);
return tmp;
}
void main( void ) {
position = ( gl_FragCoord.xy / resolution.xy );
float dest_color = 0.0;
dest_color += addLight(vec2(0.5+sin(time*1.2)*0.5,0.5), 0.5, vec3(1.0, 0.0, 0.0));
dest_color += addLight(vec2(0.2,0.7+cos(time)*0.2), 0.3, vec3(0.0, 1.0, 0.0));
gl_FragColor = vec4(dest_color*0.5,dest_color*0.8,dest_color,1.0);
}
2 simple bright blue shining meta blobs :D
have fun
-
Thanks inc, but I was reffering to another video (https://m.youtube.com/watch?v=BV9ny785UNc).
My only proper experience with shaders was actually a metaball shader which I used for a very nice verlet fluid. Now if only I could get my head around the navies-stokes mumbo-jumbo. :)