I have a POP network comprising a Grid of cubes instanced on a grid using Copy rather than GEO instancing. How do I assign a random layer from a 3D Texture to each point? Presumably I would need add an attribute to the points which holds a random integer value indexing a layer in the Texture?
Hi @pattomatica
yes, you can create a random value on the grid points (Pattern POP) and via the Copy POP move this attribute onto the cubes. A Math Combine POP will then help to use the attribute with the random values as the Tex.z attribute which will be the z lookup into a 3D Texture.
A thing to watch out for is the attribute types: There are point and vertex attributes in play here, so make sure to select the appropriate options in the Pattern, Copy, and Math Combine POPs.
cheers
Markus
I have a Random POP adding a ‘layer’ vertex attribute with random values between 0 & 3 (there are 4 images in the texture) and after the MathCombine I get this DAT result
I don’t know how to use this in the PHONG. Claude has been leading me down endless garden paths!
Patto
Hi @pattomatica
it’s best to share whole files for people to understand how far you got.
I can see that you are trying to use uv as the Texture attribute while in POPs, this is called Tex.
Since you are creating a integer based layer number, your texture will have to be a 2D Texture Array (a setting in the 3D Texture TOP).
In the Phong MAT you don’t have to do much but reference the Texture you want to use, the whole render process will use the Tex attribute to lookup the right layer in the supplied texture.
Also check out learn.derivative.ca with a whole section in the fundamentals course on POPs which will help grasp the underlying concepts.
cheers
Markus
Thanks Markus - yes it’s early days for me with POPS - I’ll do some more work on the foundations before sharing a file.
Patto
