Antoine Fortin

Yo, Ray marching is dope. Let’s write a pixelshader that handles multiple object. In short, we could use some maths, but let’s use loops because branching is sweet juce.

Your main map loop:

vec2 map(vec3 pos)
{



float planeDist = sdPlane(pos);

float sDist[12];
// Create Sphere instance
for(int i = 0; i < sDist.length(); i++)
{
pos.x += float(i) * sin(iTime);
sDist[i] = sdSphere(pos, 1.0);
}

float d = sDist[0];
// Get min dist
for(int i = 0; i < sDist.length(); i++)
{
d = min(d, sDist[i]);
}

//pos = mod(pos + 5.0, 10.0) — 5.0;
return vec2(min(planeDist,d), 1.0);

}

It makes the loop querying moves

--

--

When I use Blender for procedural stuff, I want it to be dead simple. No fucking reasons to go into deep rendering settings. As this statement follow this article, let’s take a simple look to how we displace this original shit we are dealing with in Blender.

Let’s start with…

--

--

Antoine Fortin

Antoine Fortin

Mathematic Major: Comme Simple Plan disait: Welcome to my life ❤ Je rédige dans les deux langues, sur le graphique, le C++ et la vie.