I'm building a bush that has been ravaged by caterpillars. I am working with a set of leaves, see attached image, and some of them I have created holes in the mesh, you can see in the mesh which is selected in Edit mode.

I'm trying to figure out a workflow to generate the holes randomly - sizes, location, shape - in the mesh. Thereby limiting the base set of leaves. I'm seeking a workflow similar to how you would add raindrops on leaves using a particle system: create a droplet; Particle: Hair; Render As: Object etc...

Can you think of a clever method to achieve this?

It doesn't necessarily need to affect the mesh itself, but just the transparency (transmission) for render.

The answer to this question suggests a workflow using micro-displacements, that might be a good starting point ... not sure. Maybe creating a texture with the holes, that can be UV mapped ... thinking out loud. Keep in mind the leaves already have a texture mapped onto them, and a solidify modifier with Subsurf Scattering in the material.

Grateful for any bright ideas you can share.

Leaf mesh with holes


An answer was offered to run a texture through the Alpha channel. It's close but not quite there yet. See the attached image for the setup.

  • The Base Leaf Texture is connected to Base Color - this has been unwrapped using 'U Project from view and placing the mesh on the image in UV editor.

  • This same image texture is used twice again with ColorRamps to influence Roughness input and Bump via Normal input.

  • As per the suggestion, I created a black and white texture file of leaf holes and this connects to the Alpha channel. (My understanding is that Alpha works with 1.0 = White = Opaque / 0.0 = Black = Transparent, hence the black and white image).

You can see this sort of works.

The issues:

  • This method is not random, the texture is the same on duplicates. (Might I perhaps use a larger file for the leaf holes and somehow manipulate it with an empty...?)

  • This method is indiscriminate on the leaf, I need to restrict the pattern of holes from affecting the stem (Can this be done with texture paint - or weight paint - multiple textures onto an object? So the mesh can be unwrapped onto the Base Color image texture and the pattern of holes image texture for the Alpha channel be selectively painted? Can you explain how?) This still doesn't affect the randomness of the holes.

  • Finally there is an artifact in the cycles render, the 'holes' are dark transparent grey in accordance with the shape of the mesh rather than completely invisible. (See final attached image for the Cycles render).

Further clues are greatly appreciated. Sincere thanks for your efforts.

The SetUp

Cycles Render

  • 1
    $\begingroup$ IMO the reason your holes aren't completely transparent must be because in your texture the holes aren't completely black but light grey. You can most likely solve this by adding a Color Ramp after the texture. $\endgroup$
    – enyo
    May 11 '20 at 12:38
  • 1
    $\begingroup$ The reason they are not random on duplicates is because the seed value of random nodes are same for both leaves, change the noise node to 4d and then change the W value for each leaf. $\endgroup$ May 11 '20 at 13:40
  • $\begingroup$ @ViplavPrakash that's a good approach. I solved the randomize problem with the Texture Coordinate Node; using the data from an Object; a Plain Axes Empty in the Layout Workspace. But I tried your way also and it works, the problem is that all the duplicates use the same material, so I can't change the W value for each individually. Also this gets cumbersome when were' talking about more than a dozen or so objects, and I'll be using 100s of duplicates. But that is a good suggestions, I never understood how 4D operated in the Texture Nodes. Thank you. $\endgroup$
    – Aubrey
    May 12 '20 at 9:46

What about using the Alpha channel on the texture? Create a random noise texture (or any pattern you want) and plug it in the Alpha channel. I think that the effect should be believable enough.

I would then add a simple bump map in addition to that, so the corners of the whole are a bit smoothed.


So obviously you need to play around a bit with the generated textures, but this is the way I'd approach it. Here is a sample:

enter image description here

This looks stupid because I didn't use a leaf texture or the proper model, but I think it would look quite good on yours, and it's completely procedural, so it will be randomly generated automatically and you can define and keyframe the size.

I've added a small gradient so the leaf gets browner closer to the wholes (you could blend this with a nice brown leaf texture), and a bump map, so the holes don't have a completely hard border.

This is the node setup:

enter image description here

Hope that helps.

  • 1
    $\begingroup$ Cheers for your speedy suggestion! This was a good start. I edited my question with my efforts following your idea, there are a few issues still as you can see. Getting the pattern to be random, and selectively unwrapping / painting multiple textures onto the mesh... Thanks again for your helpful suggestion. $\endgroup$
    – Aubrey
    May 9 '20 at 10:27
  • 1
    $\begingroup$ @Aubrey I've edited my answer. If something isn't clear I can explain the individual parts. $\endgroup$
    – enyo
    May 11 '20 at 12:36
  • 1
    $\begingroup$ LEGEND! That is an impressive and very helpful answer - for quite a specific question. Thank you for taking the time. I will suggest one edit to your setup. In order to RANDOMIZE the texture: In the Texture Coordinate Node pull from the Object field (rather than UV) into Mapping, and set the Object to a Plain Axes Empty this will generate the pattern randomly across all duplicates. Thanks Enyo. I wouldn't have got there without you. When I tried your initial suggestion, Noise Texture into Alpha, I wasn't getting any result. The problem: I didn't push the Scale High Enough. $\endgroup$
    – Aubrey
    May 12 '20 at 9:38
  • $\begingroup$ You're welcome. Glad it worked for you! $\endgroup$
    – enyo
    May 12 '20 at 11:30

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.