SDF Functions

Great work! Looking forward for Cycles version!
I just asked on RCS about very similar thing:

My question is - will SDF that is implemented provide that kind of function?
The ability to create procedural fallof/border between two values on bitmap or other input would be awsome.

Thought you’d be interested in this, font rendering in glsl using msdf:

1 Like

Any news or updates? This would be great to have in Blender.

2 Likes

Sorry for the dumb question. Are you talking same sdf shown in the linked video?

2 Likes

Partially, the SDF functions in D6464 only define some math primitives to define a distance field, the demo you linked has a ray marcher on top to actually render it.

2 Likes

It is possible (though rather complex and, in many ways, limited) to set up ray marching in shader nodes in Cycles.
That being said I kinda doubt results like in that video would be possible.

I do wonder if, somehow, this technique could be incorporated into Cycles. From what I understand it’s actually sorta like monte-carlo style ray-marching (well, Sphere-marching really) which might be able to deal in an essentially uniform manner with point clouds, SDFs, and regular meshes alike.

(Of course that’s quite a few steps beyond the scope of this effort here though)

Thank you for the replay.

Sorry, I’ve been inactive with Blender development due to various reasons. This is one downside of FOSS at times. As @LazyDodo pointed out, the patch is really just a Maths node with SDF functions.

2 Likes

Hi.

You might want to check out how Material Maker (an open source texture creator) does SDF functions. It has a lot of SDF nodes that aren’t too hard to figure out.

Perhaps if Blender nodes could have more comprehensive UI widgets built into them, perhaps things could be easier to control?

2 Likes

Hey, Charlie! Thank you for the response. Even so, SDF nodes would be great. I would hope that some form of SDF nodes gets into master eventually.

2 Likes

True, please also check my https://github.com/paulofalcao/MaterialMakerRayMarching for adicional SDFs stuff for Material Maker

1 Like

Patch has been updated and works on Eevee and Cycles (limited testing and not OSL)
See: ⚙ D6464 Shader Nodes: SDF Node (WIP)

7 Likes

Buildbot builds for D6464 are available here: Blender Builds - blender.org

Please use at your own risk.

5 Likes

I played a little with those functions, and they are so much fun! Looks like a great addition to existing shading nodes. And so far I didn’t encounter any problems or bugs.

I also tried to achive anything resembling medial axis transform based on existing texture, but my math skills are not enough to tell if it is even possible with this patch.

15 Likes

Highly vote for that feature to be implemented in the Blender.
Just played a bit with it and this is fantastic. Expanding the proceduralism in texturing higher than the “sky is the limit”.
Very artist’s friendly!

2 Likes

I thought I’d also share some of the results of using the SDF nodes. I added an SDF noise node (based on Inigo Quilez :: fractals, computer graphics, mathematics, shaders, demoscene and more) on top of these for some raymarching experiments:

I really like the implementation and how the node categories are laid out etc, it fits really well with blender’s design. I just wish we had group-loop nodes…

7 Likes

Thanks for the feedback. I’m still updating the patch. I’ll post when I ask for another test build.

3 Likes

Yes, there is a lot of cool things possible if it was easier to group-loops!

2 Likes

@Charlie if you add a sdf texture node with an input list of 3d scene objects we should be get some thing like DistanceTexture ??.. very useful for decals, image resolution and mesh density independents shader/texture masks, veg scatter/repulsion masks…
Is this possible?


6 Likes

Yes indeed

1 Like