Page 1 of 1

Random Color for Non Scattered Object

Unread postPosted: Thu Sep 19, 2019 6:09 am
by nadiasantoso
Hi,

I have a flower petal that is not instanced. Because the petals are sharing the same UV, I want to give the petals random color variations using TextureRandom and TextureInstanceColor. Can we use TextureInstanceColor for non-scattered objects? I tried using it and it didn't work.

Cheers,
Nadia

Re: Random Color for Non Scattered Object

Unread postPosted: Thu Sep 19, 2019 4:32 pm
by esmith
You wont be able to use Instance color operations on non instanced geometry. What you want is to produce a random variation on multiple pieces of geometry that share the same UV space (on top of each other to share the texture), but not the same world space (they are each in a circular pattern to make the flower shape).


Capture.JPG

Here I am mixing 2 textures. On the bottom is my "leaf" texture, and then using a fractal noise as a mix, I'm blending on another map that's being projected down in world space (vs UV space) so that it appears different on each leaf.

I've attached the example assets. Of course you can use other methods as well, but for a flower, maybe this is the simplest way. Note that I'm mixing 2 maps, but obviously, the 2nd world space map could just be a procedural of some type to create some of that random "burning" or "decay" that can happen on some leaves of a plant.

Good luck and let me know if this helps!

Re: Random Color for Non Scattered Object

Unread postPosted: Thu Sep 19, 2019 4:40 pm
by esmith
Also just for your further education, here is a simple instance color setup so you can see how it can work.

The green and black balls, are instances inside a combiner, of an actual red ball asset. But it's pulling color off a gradient to randomly make some of the red balls black, and some of the red balls green.

Capture.JPG

Re: Random Color for Non Scattered Object

Unread postPosted: Fri Sep 20, 2019 3:29 am
by nadiasantoso
Hi,

Thank you for your reply. But actually that's not what I want to achieve. When the geometry consists of different shape nodes, I actually can use Utility node with Vertex ID as the output. When the geometry is really only one mesh, it is when I have the difficulty to produce a random color. Is there any work around for this?

Cheers,

Nadia

Re: Random Color for Non Scattered Object

Unread postPosted: Fri Sep 20, 2019 7:03 pm
by esmith
Yes that is correct, you can't use a node that's looking for instance data, on a piece of geo that itself is not instanced. The flower is one piece of geometry. The flowers that "work" are multiple pieces of geometry, so you can use object ID from the Utility to separate them.

As you can see, all 3 of these "flowers" share the same exact material. The middle flower is using Copies of the single petal Alembic shape. The right flower is using Instances of the single petal shape. This is a very important core difference in geometry types. For your weeds that this doesn't work on, take them back into Maya and run a Mesh>Seperate function on them to seperate them into different shapes. Or seperate them and simply bring in ONE object then copy it around to do your layout, and then the Object ID will work as well.
Cadpture.JPG


The method I shared in an earlier post is a way to go about adding an overall variation to the large group of objects that all share one small UV space and the same texture. That's why I want to know what your trying to accomplish visually, so I can recommend a method.

I hope all of this makes sense.

Re: Random Color for Non Scattered Object

Unread postPosted: Mon Sep 23, 2019 3:13 am
by nadiasantoso
Hi,

So the way I understand it, Clarisse can't read and separate poly island on its own?

Re: Random Color for Non Scattered Object

Unread postPosted: Mon Sep 23, 2019 8:50 am
by dboude
HI,

No, it doesn't. No poly island on mesh and no island on UV either.

Cheers ;)

Re: Random Color for Non Scattered Object

Unread postPosted: Wed Sep 25, 2019 4:32 am
by nadiasantoso
Hi,

Now I know what I had to do. Thank you for the info!

Cheers,
Nadia