multiple image texture on subsection of a population obj

Started by Nala1977, April 30, 2020, 02:49:32 pm

Previous topic - Next topic


hey guys, sorry for so many questions but i can not find an answer on the wiki and i have no clue how to do this.

i have an obj imported as population and scattered around, its a patch of custom grass with blades, now i have prepared 4 textures, some are for a more close up render.
i would like to have these grass patches have some texture variation when they are scattering, so it will add some color variation to the whole composition, and the whole terrain wouldnt look a flat green field.

when i dig into the obj shaders i can not find a way to assign more than one texture (since it has one slots) and have it randomly assign and pick it on each blades that makes the patch.

basically i want the 6 blades of the grass patch, "fishing" randomly for 2 or more textures, so in the render they would have texture/color variation.

how can this be achieved?

D.A. Bentley


You have a couple of options. 

If you want to vary the actual textures you can combine several populations of the grass model, each one using a different texture file, with power fractals plugged into the populations shaders' density slots to mix things up.

With grass it's probably OK to let the populations overlap. Things get a little more involved if you want each population to have its own space. There are a few threads on the forum describing different ways to do this. 

If you just need to vary the color shade across the population, that's much simpler. Just use a power fractal (or several) to create a color mix, and feed the result through a transform input shader, with worldspace enabled, before connecting it to the object's color network.

Finally, the technique used in the attached screenshot randomly varies color saturation across placed objects and populations. It's a good way to break up solid areas of color. Credit for this goes to Dune. The constant color is set to white, and color is disabled in the surface layer. Tweak the power fractal settings (seed, color, scale) as needed.


You can also merge a few default (grass texture) shaders with a merge shader and use a PF + world position as controller. I use that a lot to combine bark textures on trees, or clay and wicker for old farm walls, or moss on thatched roofs.