GSoC 2024 Draft: Sculpt Node Brush

Sculpt Node Brush

Petar Dosev

Contact Info:

(I had to mangle the links so the forum would let me post)

Synopsis:

I want to build a brush system configurable using a node interface. As can be seen with geometry nodes, such a system would give flexibility to artists to customize their tools and achieve new kinds of effects that would be difficult and time consuming to create in C++.

Benefits:

Currently brushes have a limited amount of configuration options, and adding anything new requires writing complicated code. Also, it is somewhat easy to toggle the wrong setting, and then the brush stops working as expected, or you get the wrong result. Node interfaces are flexible, powerful, and already familiar to many Blender users. And if integrated with the brush assets project, this could give artists an easy way to share and experiment with new brushes.

Deliverables:

  • A new brush type in sculpt mode, living alongside all other brushes.
  • A new editor type, the brush node editor.
  • A selection of basic nodes that work together well: vector inputs and vector math.
  • User documentation.

Project Details:

Generally, a brush works by iterating over the vertices around the cursor and applying a displacement to them. This displacement would be the main output of a node group. It could be driven by many input nodes: camera direction, surface normal, pen pressure, pen tilt, stroke length, time since stroke has begun, random noise, texture maps, etc. They would be processed with math, vector math, ramps, and other intermediate nodes, similar to the other node editors.

For this project specifically, I would limit it to the basics: surface and cursor normal inputs, camera direction, and vector math nodes. If time allows, I’ll add more, but a lot can be done even with just a few nodes. The goal for this summer is a more customizable draw brush.

To simplify things for most artists, more intermediate nodes could be added, so they don’t have to do a bunch of vector math. It would make sense to model them off of the existing Blender brushes, like plane projection for clay-like brushes. This will need design, experimentation and user feedback, to see what artists would find easy to use.

I can imagine many extra features which would be very nice to have, but would be out of scope of the initial implementation, such as color output, or simulation nodes style feedback for snake hook type brushes.

Schedule:

I expect to be able to work around 25 hours per week, since I’m also a part-time C++ tutor at my college.

Dates Details
May 27 - June 7 (2 weeks)
  • Create brush prototype controllable with a node editor.
  • Discuss possible designs with mentors and users.
June 10 - July 5 (4 weeks) Iterate on design. Implement input and intermediate nodes, prioritized by user feedback and research.
July 8 - July 26 (3 weeks) Cleanup code, optimize, fix bugs, getting it ready for merging into main
July 29 - August 9 (2 weeks) Write documentation, get code reviewed and hopefully merged
August 12 - August 23 (2 weeks) Gap weeks for any remaining work

Bio:

I am a second year computer science student, currently at Broward College. I discovered Blender around 2017, and I’ve been sculpting characters ever since! This got me interested in computer graphics in general, and that’s how I ended up in this field. I only looked into contributing to Blender recently, and the code wasn’t nearly as scary as I expected. I ended up fixing an issue that has bothered me for a while: #111665 - Fix #104022: Expand Mask inverted fill - blender - Blender Projects

It’s also the reason I’m writing this proposal. I can think of many great tools I’d like to use, and I want to try make one.

9 Likes

This is not implemented yet not due to not enough time of developers or this idea was not proposed in the past. Main issue here is the performance. Can you describe few more project details about improvement of speed to geometry nodes in general to make it possible to apply them on 10m+ meshes with 20 fps and do not perform only displacement?

yes it was. look here

2 Likes

I can’t load this video, sorry. Can this details be more clear/typed?

pablo dobarro made something similar years ago when “geo nodes” was being developed.

from his tweet:
https://x.com/pablodp606/status/1095693307785760769?s=20

This the first prototype of the Node Brush. It runs a node network to calculate the displacement on each vertex so it can produce all kinds of deformations with unlimited parameters. Based on a WIP branch by
[@JacquesLucke]

1 Like

Maybe this looks interesting, but this is not technical details.

i guess that comes after the working prototype

So, what the plan of your project? I mean, do you planes to just allow to use geometry nodes as brush? This will be slow for something like Delete Geometry. You planed to limit this only for Set Positions node? Well, still slow and not something that can be accepted i guess. In case this will be accepted, how you can make this faster?

Maybe I can make it more clear, but this would be completely separate from geometry nodes. You would not be able to edit the underlying mesh, just apply a displacement to it. It will use the already existing brush code, so it can support dyntopo and multiresolution.

Initially it would only support a handful of basic input nodes, like surface normal, cursor normal, and camera direction, and the only intermediate node would be vector math. I think that would be the bare minimum you could start making interesting effects with, and I think is doable within a month.

I’m definitely not intending on making a tool that can replace every single brush type. That’s not possible in 3 months. The idea is to lay a small foundation that can be added to so in the future we can get the crazy capable tool you’re imagining right now.

1 Like

Ah, so the plan is in added new nodes system?

Yes, geometry nodes is much different in scope from a brush system. Having a brush-driven geometry nodes system sounds interesting, but is much different from what I’m thinking

Thanks for sharing your proposal here. It’s a fun idea. I’m not sure if you’ve seen it, but the old texture nodes system can do something similar. Though it is quite old, not often used, and I think it’s fairly slow.

However, to be honest I think this project is far too big to be reasonably complete in a three month time frame. A prototype is surely possible, but it only really makes sense to commit a prototype to main if there is a solid plan to make it work as well as we need it to in the long term, and also if the design is what we would like to pursue in the long term too.

Personally, long term I would much rather see a system that uses the same evaluator as geometry nodes to implement node-based brushes. Ideally it would be integrated with node tools. One idea we’ve had consistently over the last few years is that different node tree types should become less important. Just as “modifier nodes” and “node tools” are two uses of the geometry nodes system with different inputs and outputs, a brush nodes system should follow the same design. I think modal node tools are a good way to push in this direction.

10 Likes

I think geometry nodes based brushes are a great idea, but they would take a little while to be implemented. A potential sculpt node brush could peacefully coexist with them. The main two issues I could see is users being confused by the two, and having to support both at the same time.

Overall though, I think the usecases are different enough that both would be useful to an artist separate from one another. The sculpt node brush would automatically support dynamic topology and the multiresolution modifier, since it would use the same primitives as every other brush in Blender. That means it would fit more seamlessly into a sculpting workflow. I can imagine there would be caveats and complications with geometry node brushes around that.

Thanks for the feedback!

2 Likes

A brush evaluated with geometry nodes doesn’t have to do anything special. With a “Set Position” node and a bunch of field inputs, it will just be a deformation. IMO having two systems where one is a subset of the other isn’t the right long term goal, for code maintenance and UX reasons.

10 Likes

To change positions for sculpting is just a special case. GN based brushes would cover any attribute.

Your initiative to enhance the brush system with a node interface is appreciated.

2 Likes