In Copernicus, can you drive a switch with an attirbute?

   715   3   1
User Avatar
Member
58 posts
Joined: March 2018
Offline
Using Karma in the stage context, I have a simulation I made of some ropes, I would like to use the same material for all of them, but for them to have different diffuse patterns. In rendering engines I am comfortable with, I would give each rope an "index" with connectivity, then use that attribute on a switch in that material so that the materials diffuse is different depending on that attribute on the different geometry. I am not sure how to do this in the Copernicus context, or if it is even possible. Thank you
User Avatar
Member
8845 posts
Joined: July 2007
Offline
Most likely you want to generate separate textures in Copernicus and use switch in the shader based on your index primvar

Copernicus textures are created before the render so there is no way to regenerate the texture on the fly based on which object is being rendered if they overlap the same portions of the uv space

If however you have your ropes occupy different portions of the same uv space you can Rasterize your rope index into a layer and use that to switch the pattern in Copernicus to generate a single texture
Edited by tamte - July 25, 2024 16:58:56
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
58 posts
Joined: March 2018
Offline
Thank you for your reply. I think I am starting to understand. I tried to rasterize my index, but as soon as I click on the rasterize node, Houdini immediately crashes. I got it to work once for a tutorial I was doing once after trying, but cannot seem to get it to work again.
User Avatar
Member
793 posts
Joined: April 2020
Offline
I was looking for similar functionality. I'm trying to port my texture baking tool to copernicus and I need a way to sample from a different texture, switching possibly per face. I could do this in a wrangle, but then most of the copernicus benefit is lost. I thought pre-loading all the textures and using a switch might work.

Is there a way to implement something like that in copernicus currently?

thanks,
Koen
Edited by koen - Nov. 5, 2024 13:38:15
  • Quick Links