I have a set of geometries that they're generated by "Instance on points"
Now i need to set a Color Ramp attribute for these geos to set a rainbow like material to these geos
In fact, i need make an attribute for these geos to set a different color (by color ramp) to every geometry
Asked
Active
Viewed 1,045 times
1
milad shirali
- 55
- 6
-
1I think that, because the instances share the data, all of them share the same material properties. The only way that I know to do that is making the instances real. – Artichoke Nov 25 '21 at 17:44
-
1In the shader use Geometry -> Random Per Island – Allen Simpson Nov 25 '21 at 21:23
-
1Is number of vertices equal for all objects? – Harisreedhar Nov 26 '21 at 04:13
-
Yes because all of them use a same geometry to make instances – milad shirali Nov 26 '21 at 09:59
1 Answers
3
For instanced geometry, you can use Random value from Object Info node in the shader editor.
If you want to realize instances or do it from geometry nodes, This setup lets you create random color per object using color ramp.
Replace Attribute input of last Transfer Attribute node with Random Value for randomization.
Note that it only works if all objects have same number of vertices.
Update:
There is a better solution to this problem by Robin Betts idea of scaling instances to 0 and transferring attribute. Which even works with objects having different number of vertices.
Harisreedhar
- 3,054
- 7
- 11
-
Thanks a lot for your correct and proper answer. Now I have another question; In Blender 3.1 Alpha, it seems like this problem has solved In fact, in the Attribute Transfer Node, they've added an option to transfer Instanced Geometry Indexes as an Attribute, but there is a problem when the attribute is transferred to Shading Node Space, Color ramp doesn't works, even after normalizing Attribute to capture 0 to 1 Value. In fact, The attribute value in Geometry Node is showing up a set of value between 0 to 1, but these values haven't any effect in Shading Space. – milad shirali Nov 28 '21 at 07:26
-
1
-



