Quantcast
Channel: Community for Creatives: Friendlyskies Community Forum
Viewing all articles
Browse latest Browse all 73

Implicit Revisited

$
0
0

Hi.

A recent discussion here touched on the subject of the Procedural Implicit Objects. Actually I did not realize that the plugin was still/again working, but I began to feel that I had some 'unfinished business  with those, so decided to give them a new try.

(And for reasons, that don't need to be repeated here again, I ended up doing these on AoI 2.4.1)

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/HRuler.png

Then to work!

At first I had no idea what to do ... I only got some occasional faint shadows showing up in the object preview window, telling at least that something was happening, but I did not quite understand what, until I connected a Polar transformation to the Value-output.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Polar.png

And there we go: A hole through the Universe:

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Hole%20in%20the%20world.png

This was a kind of unexpected but as there obviously was a circle with radius of 1 unit there, it occurred to me to try the right  right side of the equation of circle ... So I unplugged the the Polar and connected the expression to the output.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Circle_eq_1.png

Of course it should be sqrt(x*x+y*y), but forgetting the square root did not matter as the radius happened to be 1.

The next thing to do was to figure out, where that radius is defined.

On the graphic procedural windows you rarely need to check what is behind the Edit-menu, but In the case of PIO it is actually very essential, so there it was: The properties.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Propreties.png

So the  X, Y and Z match the size of the cube and the Cutoff matches the radius of the hole. Even more importantly, where the output value is greater than than the cutoff value, there is material. Otherwise not. The surface of the object is then where the expression equals the cutoff value. What really was happening was:

1.0 = sqrt(x^2 + y^2)

Well.... Handling equations 'naturally' is a bit clumsy if you have to worry about the hidden constant value on the left side, so I changed the Cutoff to 0.0 and rewrote the expression into:

sqrt(x^2 + y^2)  - 1.0

-- and the hole was still there.

As you might think, a hole as such is not yet a very useful object. To the least, the material side needed to be changed. That turned out to surprisingly easy: I just turned the above expression negative:

- sqrt(x^2 + y^2)  + 1.0

And here we have a cylinder:

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Cylinder_R1.png

And adding the z-factor makes it a sphere!

- sqrt(x^2 + y^2 + z^2)  + 1.0

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Sphere_R1.png

Of course multiplying the x, y and z factors by numbers would make it an ellipsoid. -- No pictures of those experiments available....

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/HRuler.png

Then I decided to give a try to a parabola: At first the basic equation needed to be changed to be all on one side:

y = x^2
--->
0.0 = x^2 - y

where 0.0 is the Cutoff value in the Properties. --  The rest is, what you'd type into the Expression module.

And yes! -- The cube was cut by a parabola ! -- Picture added.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Parabola.png

Then I did a few modifications to it. First I changed it from X-Y to X-Z coordinates and flattened it by multiplying the Z by 4.0. (The easiest way of reducing the curvature of a parabola is not to go dividing the X but to multiply the projection dimension. In this case Z.)

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Parabola%20sideways.png

Here I used the piece as a  "2 and 1/2 - dimensional" parabolic reflector to create a caustics pattern. The yellowish spot in the middle is a misplaced point light. Sorry for that.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Caustics_extuded.png

Then I took, the Y-dimension into the game. In the following, the expression is:

x^2 + y^2 - z*4.0

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Parabolic_cave.png

So far, so good.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/HRuler.png

Now I wanted to do a boolean with the cylinder and the parabolic form. An intersection to be exact.

It would seem logical to use operators like Max and Min to combine the volumes that are created by expressions, but that turned out to be a little more complex. For example the Max-operator seems to make a union of two volumes, but the surface looks just weird.

The correct way of making booleans is to multiply the expressions by each other. Just multiplying the cylinder with the parabolic cave produces this:

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Multiplied.png

What happens is that
- there is material, where both expression are positive.
- there is not material where one of them is positive and one negative.
- there is again material, where both are negative.

Now, to get rid of the last portion, it needs to be multiplied by another negative value. For that we'd need the sign function, but that was not available in the procedural math (or if it is, let me know!) To obtain the sign the expressions needs to be divided by its absolute value.

I'll skip the logical contemplation about all the combinations of pluses and minuses and just put the final wiring here.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Intersection_procedure.png

Note that the signs are filtered by the Max operator.

And what we have is here:

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Parabolic_disc.png

The lighting conditions do not do justice to it ... Here is an attempt to create a caustics pattern with it. The same misplaced light here as above.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Caustics_disc.png

It would have been really cool to make a caustics pattern into space, either by this reflector or by a lens, but unfortunately the 2.4 generation was not yet able to produce scattering with secondary rays of light (reflected from a surface or traveled through an object, that is...)

One more thing, I did with that one is, that I reduced the size of the box in the Properties:

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Properties_for_the_disc.png

Now as the edge of the disc is at Z=0.5, removing the empty space speeds up rendering. Though actually the Z-dimension of the box should be a tiny bit larger than 1.0. When it is 1.0 there are three surfaces at the edge intersecting and that makes the edge a bit noisy. If the box is a bit larger, the job is easier for the ray tracer.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/HRuler.png

One more experiment to go: Moving and resizing the volumes and making a union:

For this one I created two spheres with radius 0.5 and moved them 0.4 units up and down:

- sqrt(x^2 + (y+0.4)^2 + z^2) + 0.5
- sqrt(x^2 + (y-0.4)^2 + z^2) + 0.5

....and combined the like in the intersection case above. The only difference is that the signs are filtered by a Min operator.

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Union.png

And to make sure, that it really is a union, you can use the Properties box to take a slice of the very middle of it:

http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/Union_slice.png

Yes it is!


http://www.kuukahvila.com/peteihis/AOI/howto/Implicit/Revisit_2015/HRuler.png

Now there is one thing that still bothers me a bit.... I know that there is a way to combine different volumes so that they are blended together smoothly. I can't remember how that happens, but I know, I used it in the Dripping Icicle video all those years ago.

scratchchin

I'll add the files later. -- Got some checking up to do first. Until then: Enjoy!

EDIT 1: added missing pictures & something else small.
Edit 2: Oh -- well smile


Viewing all articles
Browse latest Browse all 73

Trending Articles