3D Map based on geometry


#1

With Krakatoa, Fume, Ember, Genome etc. I often end up using 3D maps but to really get a natural look I need to mix several of them together. The biggest problem I run into is that sometimes I wish I could define areas where I would want one 3D map to be. Like a mask, but as a 3D map type. Is there a programmer at Thinkbox or out there reading this that could put something like that together? A 3D map type that lets you select an object that would define the 3D space as white and the rest would be black. An awesome addition would be to be able to diffuse the edges (falloff) or apply some noise like you can do with many other map types. Am I explaining myself well of what I’m looking for? I think it would make an awesome addition to Thinkbox’s tools (as well as other tools).


#2

Inside of Ember, a LevelSet operator gives you a Distance value whose sign can be used to determine whether a 3D point in space is inside or outside. In all Magmas (Krakatoa, Genome, Ember), the InVolume operator also gives you the same, but based on the mesh surface itself. So you can simply multiply the map color by the output of InVolume converted to Float and you will get an on/off mask behavior.

Going a step further, Ember exposes a 3D map that lets you pick a SIM Ember object and uses the Color channel (if defined) to define the map color.
For example, create a Teapot and create an Initial flow in SIM Ember with Color output set by the Sign of the Distance in LevelSet of the Teapot. Where the sign is LessThan 0, output [1,1,1] using a Switch node. Otherwise, output a Blend of [1,1,1] and [0,0,0] based on the Distance divided by a Falloff Float value, to the Power of another Float value (the Faloff Exponent). This will give you a smooth transition from white inside the mesh to black outside the mesh at distance of Falloff…
Now create a Sphere and assign a Standard material with DIffuse set to Ember Texmap. Set the Map Coords to World and pick the SIM Ember. Now the Sphere is colored white inside the Teapot and black outside, with a gradient falloff around the surface… This map could be used anywhere a 3D Map is accepted, including other Magma-based plugins like Krakatoa and Genome, and other Embers (although it probably makes more sense to use directly the LevelSet node in the Embers instead).

Of course, having a 3D Map that is DIRECTLY defined by a Magma flow (without using SIM Ember) is on the Wishlist, so the above is a rather heavy workaround to what you asked for :slight_smile:


#3

Very useful information as always from you Bobo. I didn’t realize Ember had a 3D map but I will definitely check it out now that I finished this project that’s been sucking up all my time. That is great news, I’m a huge fan of 3D maps. A 3D map that is directly defined by a Magma flow that you mentioned at the end would be absolutely fantastic, but I’ll definitely check out the Ember approach (assuming I am not too late to get a code for the beta). Been meaning to be more involved but this last project was really one of the crazier ones. For the next feature I am working on we’re doing a lot of Nebula stuff so that’s why I am RnD’ing lightly before we get started on it. I’m thinking it will be a lot of Krakatoa, Fume and maybe Ember.

When you do get around to doing a 3D map defined by Magma Flow, will that come just with Krakatoa or all your products that use Magma?

Thanks Bobo!


#4

As an additional request if possible for this Magma 3D Map, would it be possible to collapse multiple composited 3D maps using a Magmaflow to speed up rendering? I usually end up with a bunch of 3D maps mixed in all manners of ways and of course this slows down rendering. If there was a way to define a world space region and collapse the values of all the mixed 3D maps that would be ideal.


#5

I think that once we add output to a 3D field format (like Field3D or OpenVDB), you could create an Ember field using any number of maps, then save the field to an external file and use it as a cache. Not sure if this would be faster though. Time will tell.


#6

I guess keeping it as a 3D map is the goal, so if I put together a magma flow with all kinds of different methods, involume, 3d maps then the Magma 3D map would just read that and it should be fine for all my uses for Fume and whatever else. Field3D would be a nice addition too but perhaps for different scenarios than what I am thinking.