Hi, I'm trying to create trees over a ground surface with Pflow.
My trees are very simple and consist of a multi-material with two slots, one for the trunk and one for leaves. To add variation to the tree leaf colors I want to use Color jitter in the base color channel for the leaves.
In Pflow I use Position object and Shape instance to create the trees. However, all the trees look the same material-wise, it loses the jitter effect.
Any ideas how to get it to work?
Thanks
Sample scene? I'm not a 3ds max user
test-material-colour-jitter-01max.zip
Hi, the individual objects in the foreground work correctly with color jitter (as I understand it), but when I use one of them in Pflow it looses the jitter. Seems to me that once Pflow samples the geometry and material if goes on it's way, and creates all the instances, not referring back to the material again.
Thanks
Max 2019
The Pflow-generated trees are translated to Arnold as a single polygon mesh, and it looks like all the canopies become one selection of faces, and all the trunks become another selection of faces, and so the Multi/Sub Object material makes all canopies one color, and all trunks one color.
Not sure if there's a way to change that...still looking at that part of the problem
I didn't think it was an unreasonable assumption to make that color jitter would affect the color of particles, given that particles are a easy and powerful way to create objects in a scene.
Thanks for your efforts/time.
Thankyou.
The problem is that the pflow trees are exported as a unique polymesh. So, color_jitter returns the same color for all of it, because the jittering seed is the polymesh id.
I can offer you the following workaround, as in the attached scene.
Your trees are made of 224 triangles. If you take a state_int mode, its variable set to fi, it returns the triangle id (the forest has 44800 triangles). If you divide the output by 224 and you convert the float value to integer, then you have a unique, different value for each tree.
The divide node outputs a float, but once you connect it to the color_jitter's obj_seed, it gets converted to integer.
At this point, color_jitter will work based on a random seed that is unique for each treee, and so you get the desired result.
Of course, if you change the resolution of the master tree, then you'll have to adjust the magic divider.
Let me know if you need further help to understand the setup.
You may have just saved the day - thank you very much.
This is just a quick scene to demonstrate the issue, the actually scene has thousands more complicated trees, so I'll just adjust the numbers and have a go.
Very good!
Have a great weekend 🙂