Mapping material based on color?
1092 1 0- yashberi
- Member
- 2 posts
- Joined: April 2020
- Offline
- Enivob
- Member
- 2544 posts
- Joined: June 2008
- Offline
Each one of those squares in the grid is called a primitive. Promote your color to the primitive context. After that, you can use a primitive wrangle to write the attribute which holds the name of the material.
The next step would be to actually manually create three new materials in the /mat context that match the names given in the code. That's all there is to material assignment in Houdini. It is a string attribute called "shop_materialpath" that points to a material.
NOTE: Inside the Solaris context materials work a differently so you have to decide which Render system you want to use first.
s@shop_materialpath = "/mat/mat_center";
if (@Cd.r > 0.6){s@shop_material_path = "/mat/mat_red";}
if (luminance(@Cd)<0.1){s@shop_material_path = "/mat/mat_black";}
NOTE: Inside the Solaris context materials work a differently so you have to decide which Render system you want to use first.
Edited by Enivob - Oct. 1, 2020 09:46:28
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
-
- Quick Links