Geometry Nodes - how to realize instances with material?

Hi,
Does anyone know if there’s new feature to “realize instance” generated from Geometry Node with “material” ? Currently I cannot get any material when setup with a “Realize Instances” node in the GN tree and then apply the geometry node modifier.

It works for me in 3.1 beta.
Setting the material for the instances in any of these three positions gives me instances with material before and after applying the GN modifier.

Edit I also checked with an instance that already had a material applied and it worked without the set material node.

Which version of blender are you using?
What is your node setup?

Hi @DNorman
Sorry took a bit of time on this.
The object I have is using older version 2.9 set of Geometry Nodes.
The minute I connect “Realize instances” … the material color goes off.
Well good to know 3.1 nodes works … I will see if I can get similar GN setup for foxgloves flowers

AAAAAAAHHHHHH 2.9.

I strongly recommend you update to 3.1 for work with GN nodes.

Warning!!! the files are not backward compatible so keep a 2.9 version of your file saved in a safe place.

Sorry to tell you (you may already be aware) but the GN node system was radically rewritten in 3.0!

It is a change for the better and the system is much more logical and powerful with many new nodes.
It is also in constant development so every week there is new stuff getting in. I am afraid you will have quite a bit to catch up on.

The downside is that many legacy nodes no longer exist and have been replaced or refactored, the workflow has changed completely.

If you watch tutorials you should make sure they are all 3.0 up.

To get started the main change in philosophy is called “fields”.

AGAIN
Warning!!! the files are not backward compatible so keep a 2.9 version of your file saved in a safe place.

2 Likes

ok thanks @DNorman for the advise.
I will go with those setup in 3.0 and above … too difficult to try and convert legacy nodes to new nodes :frowning:

Also legacy nodes will soon be depreciated altogether.
It is worth while getting used to the new system, there are many new possibilities :slightly_smiling_face:
Good luck.

My materials are showing, but my color ramp driving color selection isn’t being used when I have the realize instances on. The color ramp works without realize instances, can’t figure out how to get it to work with it if you have a clue

Can you share a screenshot of your GN node setup (or just the relevant part if it is huge), your shader settings and how you are driving the colour change?

I am not an expert but someone will probably be able to help.

Here are my geo and shader node. I have a set material that was not working using the defaults node wrangler gave me, so i needed to add the attribute node for my texture to show.

My collection of objects being joined have their material being randomly chosen off of the colors provided in the color ramp. I can see my collection using the color node changes properly, but they are all one solid color as instances, only with the realize instance node on.

I’m using the realize instance to have 2 collections of objects join with another object in an array, the instances from the collections don’t show on the array dupes without the realize instance, hoping that makes sense as an explaination

I just made my account to ask, I guess i’m restricted to 1 thing of media per post

1 Like

So here are the 3 pictures i wanted to put into 1

Yes you will soon get more privileges if you read a few posts etc. Here is a like in case that helps :slightly_smiling_face:

I will take a look and get back to you.

1 Like

The problem is that when you realize the instances they are no longer different objects and will not give a random value per object (they just give one value which is the value of the object with the GN modifier)

You need to create a random value from 0-1 inside the GN modifier and output it to use in the shader editor to use as a factor for the colour ramp.
The way I found to do it was this:

What it does is I captured the index value of the points I used to instance the spheres, I fed that value into a random value node 0-1 and outputted the result. Then I used that attribute in the shader editor (I gave it the “name random0-1” in the output field).
Here is the file.

Index.blend (125.5 KB)

Edit:
I am not sure what the problem is with your last screenshot your UV map should work (as you are entering it as an attribute)
Here is the same as I did before but using UV’s to map the wave texture:

2 Likes

I think I sort of understand the how lol. I got it to work though, thank you very much for the help!

My last screenshot wasn’t really needed at all, I thought I’d said something about how I wasn’t able to get the texture to pull in with node wrangler’s default setup, needing the attribute node to pull in the material. I was maybe going to segway into a “i don’t quite get the attribute node” but the more exposure i’m getting to it, i think i’m understanding more that its sorta just an attributes bank/portal

I am getting my head round all this as well, which was why I was interested in your question, I have to admit that it was a bit of trial and error for me too.
I am not sure if this is the “correct” way to do it but it works. :grinning:

The capture attribute node is able to capture a field of values from a certain segment in the GN tree. You can pass that attribute further down the line inside the GN setup and also output it for use in the shader editor with the shader editor’s input “attribute node”.

I hope one day the different node editors will be more integrated together and we could set up materials and GN nodes in the same place passing the attributes by simply plugging one into the other. I do not know if this will be the case.

There is also a new named (custom) attribute system for GN in the experimental stage, I have not played with it yet.

1 Like

Hi DNorman,
I am now doing similar GN setup for a flowering creeper plant but using Geometry Node 3.1 nodes. However my challenge is I still can’t realize the instances … error received is "Transform Curve to Mesh to in order to apply constructive modifer.

When I try to apply “Curve to Mesh” node, it messes up creeper as I need to simulate the leaves (pink flower from big to small). Showing 2 pictures … what I needed … and what happens when I connect Curve to Mesh node to it that messes up my simulation.
… What I needed
image

… how it messes up if I use the “Curve to Mesh” node"
image

Mmm, I am not quite sure how you are doing this but it looks like the scale depends on the spline parameter of the curve and the rotation on the curve tangent. When you convert the curve to mesh you loose those parameters.

I recreated the setup you show and did not get the "Transform Curve to Mesh to in order to apply constructive modifier” error, maybe it could be due to part of the setup that is not in the screenshot.

If I do plug in the curve to mesh node before the instance on points all the instances disappear as the scale becomes 0 (because there is no spline parameter value)

You could capture the curve tangent and the spline parameter before converting curve to mesh with the capture attribute node, then you can use them after converting to mesh like this

For me this setup gives the same result as my first example. In both cases I can realize the instances with no error.

By the way I like your creepers! :slightly_smiling_face:

Thanks for your prompt reply @DNorman
Using the “Capture Attribute” node did retain the structure … now I understand this node finally :).
However, when I add “realize instances” node …the material disabled “just pink color”. Is that expected that 3.1 still cannot realize “material” ?
Also when I click apply to the GN modifier receive the same error …
image

My updated node using “capture attribute”.

There are repeated 3 parts similar setup for “flower” , “upper part leaves”, “lower part leaves” and the “stem” …

The front part for mode detail / zoom in view


Stem

Flower

Lower part leaves

Material disabled when I add in “Realizer Instances” node

And click apply on modifier GN give error message …
image

Ok, looking at the whole setup the error comes from the fact that you are using a curve as the original geometry that has the GN modifier. It is a restriction of curve objects and does not come from inside the GN setup.

If you add a new curve to the scene and give it a bevel modifier you will get the same error (without any GN modifier) if you try to apply the bevel modifier.

As you probably want to draw/extrude the original curve to “grow” the creepers, if you convert your original curve geometry to mesh you will loose all its parameters and the setup will not work. So in this case applying the modifier is not an option.

Edit:
The way around this would be not to use the curve as your base object that has the GN node modifier.
Use a mesh object as the base object (a plane will do) and input the “base/DrawMe" curve with the object info node. Then you can edit the Draw Me curve and apply the GN node to the plane when you are done.


As for the texture it looks like it is UV mapped to the flowers and when you realise the instances the UV map is lost.

If you give the flower object the texture (the “petal” object you are instancing) and use an “attribute node” with the UVMap to map it in the shader editor the map will not get lost. You then do not have to set the material in the GN node setup as the instances already have it.

It sounds a bit complicated so here is a simple example. Look at the shader setup of the “petal” and note the attribute node mapping the texture. Then look at the GN node setup and note that I did not have to use set material.

Here is the file:
Curve.blend (129.5 KB)

2 Likes

Thank You so much @DNorman for the solution.

I have now learn the use of “Attribute” node in Shader … and how to realise instances from a curve-based GN !! Hurray !! .

You are indeed so good in this GN stuff; I still find it hard to understand GN nodes but with your guidance, truly amazing to achieve this results. Now I can create any kind of creepers with beautiful flowers as “particles” … to be added into a “flower hanging garden”.
image

2 Likes