3
$\begingroup$

One feature that I use frequently in shader editor, is an option to toggle between different shaders or textures. It can look like this:

enter image description here

Changing the value node on the left within the interval of 0.0 to 0.3 allows me to quickly change the used diffuse shader. This setup can be used for a lots of stuff.

How can I replicate this setup in geometry nodes with the intention of changing different geometries?

Let's say I have a cube, sphere and a monkey in my scene and I add a geometry nodes to the cube. The other two objects are loaded using object info nodes. Since Join Geometry node doesn't have a factor, I can't really switch between used geometry.

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ There is a "Switch" node in the latest 3.0 beta version : youtu.be/GLI1qluppFM?t=649 It has not yet been updated in the docs. I think it will not be available in the next 2.93 release. $\endgroup$
    – Gorgious
    Apr 21 at 17:43
  • $\begingroup$ @Gorgious Yeah that's a good solution. I guess we will have to wait. $\endgroup$ Apr 21 at 17:50
1
$\begingroup$

You can do that quite easy with a Point Separate node.

enter image description here

In the image above I've created a mesh with a single vertex. The node network splits into two paths based on the attribute value do_monkey, which is set by the Attribute Fill node (or by anything else that you need).

$\endgroup$
2
  • $\begingroup$ It's kinda of an awkward solution, because it requires a single vertex to work, but it kinda works. I will use it in the future, until the switch node gets implemented. $\endgroup$ Apr 23 at 18:25
  • $\begingroup$ It might “feel” awkward but it’s totally fine :) In fact you will need points all the time to instantiate anything in procedural networks. Sometimes you’ll even create a complex invisible mesh just to grab some points from it. $\endgroup$
    – null
    Apr 23 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.