Community
Arnold for Maya Forum
Rendering with Arnold in Maya using the MtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pflow and color jitter

9 REPLIES 9
Reply
Message 1 of 10
robw
517 Views, 9 Replies

Pflow and color jitter

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

Tags (1)
Labels (1)
9 REPLIES 9
Message 2 of 10
robw
in reply to: robw

@Stephen Blair

Hi, does anyone have any ideas about this?

Message 3 of 10
Stephen.Blair
in reply to: robw

Sample scene? I'm not a 3ds max user



// Stephen Blair
// Arnold Renderer Support
Message 4 of 10

@Rob Wesson, can you attach a simple scene reproducing the problem ?

Message 5 of 10
robw
in reply to: robw

2211-test-material-color-jitter-01a.jpg

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

Message 6 of 10
Stephen.Blair
in reply to: robw

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



// Stephen Blair
// Arnold Renderer Support
Message 7 of 10
robw
in reply to: Stephen.Blair

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.

Message 8 of 10

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.

2216-color-jitter-me.jpg

Message 9 of 10

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 🙂

Message 10 of 10
robw
in reply to: robw

@Nicola Jannuzzo

THanks

thanks again - I've been struggling with that all week.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report