Using procedural texture to change colour of leaves in cycles

Hello everyone,

Currently the leaves of my tree are all one colour, which of course isn’t very realistic, I found a tip for BI to use a cloud texture, which simply makes all the parts that are white in the cloud texture a different colour.

How would I implement that in Cycles? Maybe mix two diffuse nodes, and connect the fac socket with a noise texture? Or is there a better way?

Just tried it out and the thing with the noise texture doesn’t seem to work. Also a mix node would probably change the overall colour and not make two different colours. So my idea above is crap…

Thanks for taking the effort and google this :wink: But unfortunately, I had already found this tutorial, the problem here is that my leaves are all one object (tree has like a thousand leaves), so I doubt this will work for me :frowning:

I am essentially looking for a shader setup, which does the same a cloud texture would do in BI. In the tutorial I found, the guy also had the leaves as one mesh, and he used a simple diffuse for the base colour (like me). Then he added, in BI, a cloud texture which affected the diffuse in a way that all the parts that were white in the cloud texture would have a different colour (yellow in his case).

Mixing two colors with a noise texture on the “fac” input is the Cycles way of doing it. You want to use the MixRGB node connected to a single shader though. Keeps the properties simpler and is ever so slightly faster. You can use the color ramp node instead of MixRGB if you want more color options. You might need to adjust the texture scale to get the effect you want. You said you tried something like this and it didn’t work? Could you post a screenshot of what result you got and the node setup you used?

This is my node setup:


Now that I use MixRBG it actually changes the colour, but as I had expected it doesn’t change the colour of single leaves but simply mixes the RBG values. Ah, and I realized just now why it didn’t work when I used a simple Mix shader: I forgot to connect it to the Translucent shader, that’s why it still appeared mostly white.

I bet my mistake is really stupid, I’m just not used to procedural textures -_-

since your leaves are not duplicates anymore, you can separate the mesh into loose parts (p-key while in edit mode), and then in the material, use the ‘random’ output from Object node, as a factor for any change you want to do in each leaf.

Yeah, I guess I have no other option. I already thought of doing that, but it will be a pain to move the tree after seperating the leaves ^^

You could just parent them to the tree, or you can certainly do it with nodes on one object. Your nodes won’t work the way you have posted them. You have color nodes going into bsdf slots. Notice the green and yellow colors (on the node inputs and output, not your green and yellow colors). Green nodes must go to green nodes, and yellow nodes too. Here is your node setup done the way blender wants.

mixrgb node: used to mix 2 colors. These colors can then be fed into the color slot of a bsdf node. To mix 2 different bsdfs you would use a mix shader.



You might want to reconsider doing the tree again using a particle system to save resources.

There are 891000 faces in your scene and Blender says it uses 616MB of RAM. Most of those faces has to come from the leaves, which are real geometry.

I made quick mesh trees. Tree trunks take 143888 faces. Then I modeled two branches that have leaves and filled the trunks with those using a particle system (5% visible in the viewport).



Resulting to 18,301,327 faces and took 43MB RAM while rendering (peak). Face count from Blender render, memory usage from Cycles.

Here is the shader I used for this image:
http://www.blenderartists.org/forum/showthread.php?329881-Tethered&highlight=
Basically, you give the back side of the leaf a slightly different color.


Wow, thank you very much guys! Exactly what I was looking for, and also thanks for pointing out the thing with the leaves… I was already wondering how I would go about adding more trees to my scene, because with the leaves visible my viewport was going painfully slow ^^ Anyway, you helped me out quite much here, so again, thanks :slight_smile:

Here is the shader I used for this image:
http://www.blenderartists.org/forum/…red&highlight=

That scene looks gorgeous, I’m always looking for motivation on what’s possible with Blender environment wise.