Community
Arnold for 3ds Max
Rendering with Arnold in 3ds Max using the MaxtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Driving jitter with instance position

4 REPLIES 4
Reply
Message 1 of 5
matthias.richter
209 Views, 4 Replies

Driving jitter with instance position

Hi, I'm trying to do some deterministic hue jittering of leave colors of trees. Since this is a huge scenario the trees are created by MASH as instances using stand-ins and placed only in the camera frustum thus object ids and count can change on a per-frame level. The only static thing is the position of the instance. I was thinking of using the world space translation of each tree to drive the aiColorJitter node. Using a simple setup without instances this works and color changes as the object is being moved around. Is it possible to get the instance position to drive the color?


I'm totally open to simpler solutions 😉

Tags (1)
Labels (1)
4 REPLIES 4
Message 2 of 5

Instances (Arnold ginstance nodes) have a transformation matrix.

How are you driving the jitter with the world space position?



// Stephen Blair
// Arnold Renderer Support
Message 3 of 5

In my test case I used the translation of the node, got rid of the sign and extended the range a bit. Then I normalized it multiplied it to stretch the seed values. The result is converted to an integer value and piped to the seed attribute.

1622558589001.png

This should work as long as I can make connections from the translation attribute which I can't when it comes to dynamically created instances from the geometry instancer. This is where I'm stuck.

t_Position_to_Color_Jitter.zip

Message 4 of 5

Ok, I see. I was looking at using aiStateVector to get P (the world space shading point). Not sure yet if that works...



// Stephen Blair
// Arnold Renderer Support
Message 5 of 5

The aiStateVector is great. Helps a lot. Is there any way to access the bounding box size in a shader?

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

Post to forums  

Autodesk Design & Make Report