Home Unreal Engine

Distance Field Modeler for Unreal Engine

grand marshal polycounter
Offline / Send Message
Obscura grand marshal polycounter
I've already posted a lot about this in my sketchbook thread but I think it deserves its own especially since now its official that I'm going to release it in q3 of this year.

For newcomers, this is a project I'm working on in my free time for around a year with bigger and smaller pauses here and there. I started prototyping somewhere in the middle of last year and I'm reaching the end of the development of the first version soon. Its a similar tool to Clayxels or Mudbun for Unity. It allows you to boolean model things inside Unreal Engine, using distance fields.


The scene on the picture above was made and rendered using this tool. The distance field models are stored as volume textures, and they are rendered using a type of ray marching called sphere tracing. This technique takes advantage of the underlaying distance field to accelerate the tracing. Due to the volume textures, this is basically a voxel based format, and also allows for cubic looking voxels, but I don't have a nice example picture of that yet. These voxel/distance field models can also live together with polygonal meshes just fine and it intersects and sorts correctly. Some default Unreal Engine lighting features work with them as well, but not all of them.

It will be a marketplace asset, and the planned release date is somewhere in q3 of this year. The initial version will have fully functional boolean operator with union, subctraction, and intersection, 10 different types of distance field primitives, static and dynamic volumes, bevels, 3d noise based displacement for surface detailing, and more.

I will be posting about this tool in this thread from now on. Full feature list of the initial version, and example pictures and videos of the features are coming soon.

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Some pictures of experiments with the tool from earier:


  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    The "material only" checkbox on the sdf objects turns them into a volumetric decal kind of thing that can be used to texture the sdf models.

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Soft blend a cylinder and some spheres-> boolean intersect with a torus primitive-> add the donut-> add sprinkles.

  • carvuliero
    Options
    Offline / Send Message
    carvuliero hero character
    Could you explain in more details how this filed work under the hood + I have few questions :
    Is this true boolean or just a shader trick like just hiding parts
    What are this form made of polys ,functions some other math magic could you show wireframe of they have such a thing
    Whats the performance of this type of forms are they optimized are they usable in practical sense , pros and cons ?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    @carvuliero Hi. These are not made of polygons and its true boolean modeling. Its a volumetric modeler and the end result is stored in 3d textures that gets rendered using a type of hardware independent ray tracing, called ray marching. They can be shaded like regular polygon meshes, and usually they are indistinguishable from a high poly mesh just by looking at it. Its a similar tool to "Clayxels" or "Mudbun" for Unity. Look those up to get a better idea. The underlaying data is "signed distance fields" and they have the benefit of being able to do these booleans with no effort. They can also have bevels , smooth blending and such for no extra cost.  Its mathematical shapes and they are volumetric so they have inside/volume. More complex shapes can be created by combining/booleaning/blending the shapes. Easy displacement is also possible. Of course like everything else, this technique has its downsides as well. For example you cant really move individual vertices, because they dont exist. Its a little bit like soft clay sculpting plus booleans. I made the tool in a way that the user doesn't need to do any math and you just drag and drop the primitives into the viewport, set up some parameters for sorting order, and blending, etc. Its also non destructible, and you work with it right inside the Unreal editor. The catacomb/dungeon scene was entirely created using such models. I modeled the different pieces with the tool, and then duplicated them a few times to create a scene.

    Check out the Unity examples I mentioned.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Distance field models made with my modeler tool can be converted to a static asset, and then they can be duplicated in the level to make a layout, just like regular polygonal meshes.

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    The "material only" feature together with the soft blend can be also used to create a gradient. Detail can be added to the transition by adjusting the noise parameters.


    Someone on twitter asked if this can be applied on regular polygonal meshes, and while currently it wouldn't be easy, I find this to be a neat idea, so meshes could be textured volumetrically with sdf shapes. It would be pretty easy to bake it out to a 2d texture based on the mesh's uvs. This won't be in the initial version, but I made a note, and it will possibly come in the first update.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Smooth union, subtraction and intersection:

  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    soo,

    there's not much stopping you having these deform along splines really is there? ....
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    There are certain optimizations being applied to the ray marcher, that are based on some ray-bounding box intersections, and I'm pretty sure this wouldn't just work when trying to deform them along a spline. Are you trying to ask if a character could be animated with these? Cause there are other ways to do this.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    One of them is to simply model the character with the tool, then polygonize it with marching cubes or dual contouring, and then just rig it in your software of choice and then bring it back into Unreal as a skeletal mesh. Or you could just arrange the sdf objects in a hierarchical way in the tool while modeling the character, and simply animate the sdf objects themselves inside Unreal. I do not have a way to store these kind of animations though, and its not even a priority right now. But polygonization is. Because of this exact reason. But, dynamic volumes are supported, although they are not the fastest thing at the moment when the model is made out of many parts.
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    not animation. 
    Deforming the volume itself with a spline / function (eg a bend modifier) doesn't strike me as being a massive leap over what you already have. It'll depend on what sort of cunning stuff you're doing to make it go fast though I guess


  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    There is an sdf bend function but that won't let you freely deform them. It also has to be made sure that the quality/accuracy of the sdf itself doesn't degrade too much because that can cause artifacts in the rendering, and even show it down. But I would imagine its still doable somehow. I would need to do some research to be able to clearly answer this.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Cubic voxels (box intersection) with per voxel lighting for now. I'll add per pixel lighting as well.

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
  • MetinSeven
    Options
    Offline / Send Message
    MetinSeven polycounter lvl 2
    This looks very promising. I've been experimenting with the new MagicaCSG editor, and that's still very limited.

    Is there an alpha / beta version available of your tool, and does it support meshing and exporting to FBX?

    Thanks.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Hi. there will be, but not in the initial version. I will probably add it in the first or second patch.

    What do you mean by limited? People shouldnt expect this kind of softwares to be as good as Maya or other modelers, at least for now. Dreams for PS does a great job, and you can do a whole lot of things with it in my opinion. Distance fields are very different from regular polygonal representation, and therefore some things are impossible or hard to do with them, but they have their own benefits, like the volumetric nature of things, easy booleans etc. Still, these kind of approaches shouldnt be taken as they are trying to reform the way things are done, cause they dont. its just another tool in the toolbox, and it can be still useful for indie projects with stylized graphics, or still images.
  • MetinSeven
    Options
    Offline / Send Message
    MetinSeven polycounter lvl 2
    Thanks for your reply.

    I meant that MagicaCSG does not include the option to export to FBX yet, for example. I'd love to be able to use the results in a different package, like Blender or ZBrush, to finish it with details, and render it with a different renderer.

    I love SDF modeling. It's very intuitive and stimulates your creativity. Here are a few examples I made with MagicaCSG the past few days:




  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Cool models! 

    Ephtracy has a physically based path tracer as his renderer so I don't really see the point of rendering elsewhere because it can't really get more accurate than that. 

    MudBun and Clayxels for Unity has poligonization so you could try those  if you would want to export them to a dcc later.
  • MetinSeven
    Options
    Offline / Send Message
    MetinSeven polycounter lvl 2
    Thanks!

    Yeah, I'm installing Unity as I write this, to try Clayxels and Mudbun.

    MagicaCSG's renderer is very good indeed, but currently it has no alpha transparency output, that's one of its limitations. Right now I can't use it to render icons for example. But that will undoubtedly change in the near future.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Make sure to report this kind of things to him as well, because otherwise he cannot know what the users wants. This one is something very simple, and I see no reason why he couldn't add it in an update.
  • MetinSeven
    Options
    Offline / Send Message
    MetinSeven polycounter lvl 2
    Yep. I started a MagicaCSG Reddit with a pinned wishlist topic.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Cool. Some of your wishes are hard to do though :D The quality/accuracy of the distance field highly determines the quality of the final model and the render. Artifacts may appear when too much distortion is applied to the distance field, without correcting its values for this. Unfortunately sometimes the correction takes so much effort, that its the best to simply recalculate the sdf using flood filling. And at this point, the whole thing looses its point. So we (developers of sdf tools) are trying to get things working in a way that doesn't degrade the accuracy of the sdf too much, and doesnt require application of flood fill. This somewhat limits what we can do, but honestly, its not that easy to keep these kind of things running nicely when the model is made out of many parts anyway, so I would say yet there is a limit to what we can do with the sdf in real time - and we want it to be real time. That being said, bending and twisting is possible, but I think ffd would be hard for example.
  • MetinSeven
    Options
    Offline / Send Message
    MetinSeven polycounter lvl 2
    I understand, thanks for explaining. SDF is an exciting technique. I'll keep track of the developments, and if you could use an alpha / beta tester for your tool, just let me know.

    Good luck!
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    My tool is going to be released somewhere in q3 of this year, and there will be a test period a few weeks before it would go out. In this period, I will give away a few copies to people to test. I'll try to remember you, but there are already a few people asking for this, so please contact me when we are there. You'll see it because I'll make some posts about it before it would happen. Thanks. Stay tuned.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Here is a higher res image of the geode thing.


    Versus the same thing with the smooth surface shader:


  • MetinSeven
    Options
    Offline / Send Message
    MetinSeven polycounter lvl 2
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    I think its safe to assume that magicaCSG will get support for meshing etc, in the future -  magicavoxel has grown very nicely and i have faith that he'll apply the same approach to  CSG . 

    obscura - is openVDB support a thing that you're looking at ?  a route in and out of external DCCs would really make this shine. Shouldn't be a massive pain in the dick to implement an import/export plugin via python (assuming you can work out a way to distribute it) 
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    No I dont think so. Actually UE already has an old version of the open vdb library included but its so old, it cant import vdbs newer than 2017 or so. Also, making polygonization makes more sense to me because if it would be a vdb, you would still need to turn them into polies first when you would want to fork with them in a dcc. Vdb is also not a gpu friendly format at all so I would need to do conversions back and forth.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    So apparently Lumen indirect in UE5 works mostly correctly with my sdf models by default, even when they are ray traced surfaces.





Sign In or Register to comment.