Page 1 of 1

Scatter instance colour driven by surface geometry color

Unread postPosted: Mon Apr 24, 2017 2:22 pm
by pjenness
Hi

I have a situation where I want to drive the colour (or multiplier/hue) based on the surface that my grass/plants are scattered on.

Ive seen a few examples where the scatterer samples the UV coordinates of the surface and uses a map/texture at those UVs coordinates.

However Im not sure this would work with a complex colour setup (combinations of tileable/Cubics/procedurals/noises and also photo based projections).

So basically I need the final colour of the surface object at the scatter's seed point to be the sampled colour, and then use that as a mult/mix/hue shift input etc.

Is that possible?
Thanks

-Paul

Re: Scatter instance colour driven by surface geometry color

Unread postPosted: Mon Apr 24, 2017 4:21 pm
by isoyann
Hi,

Yes, it is fully supported, even with complex camera mapping /UVs / tiles / procedural etc.. Some complex setups may not be supported (like nested scatters used as a support to drive the color of other scatterers, and I'm not even sure this doesn't work), but in this case you can render to texture using the Uvs of the support , and dynamically use the result to drive your instances color.

Thanks,

Yann

Re: Scatter instance colour driven by surface geometry color

Unread postPosted: Fri Jan 11, 2019 8:09 pm
by square01
If we bake the pointcloud , is there anyway to keep the support colour?
Currently if I press bake it gets rid of the colour pulled by support colour .
Thank you
Johnny

Re: Scatter instance colour driven by surface geometry color

Unread postPosted: Fri Jan 11, 2019 8:15 pm
by sam
Hi,

Short answer nothing out of the box.
Long one, it's actually tricky but possible. You need to bake each support color node in a new property of the point cloud. Then you need to readjust the shader to use these property instead of the support color(s). There's a example in Python in the documentation on how to evaluate a texture and bake its result in a property.

Re: Scatter instance colour driven by surface geometry color

Unread postPosted: Fri Jan 11, 2019 8:57 pm
by square01
That sounds nice, I was thinking of doing was adding a Cd attribute in houdini and do the same thing, but if I can do it in phyton that will be pretty good, I will check .
Thank you
Johnny

Re: Scatter instance colour driven by surface geometry color

Unread postPosted: Fri Jan 18, 2019 7:24 pm
by square01
Hi Sam, thank you for pointing to that, it works really well.
Cheers
Johnny

Re: Scatter instance colour driven by surface geometry color

Unread postPosted: Fri Jan 18, 2019 7:29 pm
by sam
Hi Johnny
Glad it helped. The only drawback is that it could tend to create huge project files depending on the number of instance color you bake because the point cloud container is stored in the project file.

However thanks to the new point cloud property support of the alembic exporter, you can now externalize the container in an alembic cache and reference it back into Clarisse!