How to switch Octane materials based on an attribute

Forums: How to switch Octane materials based on an attribute
Houdini Integrated Plugin

Moderator: juanjgon

How to switch Octane materials based on an attribute

Postby rustyippolito » Sat Mar 23, 2024 11:35 pm

rustyippolito Sat Mar 23, 2024 11:35 pm
Is there a way to switch between two Octane materials based on an integer (0 or 1) which is specified in an attribute promoted from a group which animates? I am using a group node with "Keep by Random Chance" enabled and animating the value down over time (turning off windows on a building facade). Having trouble trying to switch between two materials (ON and OFF) based on the attribute called "SWITCH". If anyone has any ideas i am all ears:)
rustyippolito
Licensed Customer
Licensed Customer
 
Posts: 88
Joined: Wed Mar 08, 2017 10:07 pm

Re: How to switch Octane materials based on an attribute

Postby galleon27 » Sun Mar 24, 2024 11:28 am

galleon27 Sun Mar 24, 2024 11:28 am
Here you go. I've attached a file. You have to cast your attribute from int to float since integers don't work when using attributes inside shaders.
Attachments
switch.zip
(52.24 KiB) Downloaded 17 times
Win 10 64bit // GTX 4090 + GTX 3090 // 5900x // 64GB // SideFX Houdini // C4D
User avatar
galleon27
Licensed Customer
Licensed Customer
 
Posts: 240
Joined: Wed Jul 15, 2015 11:55 am
Location: Serbia

Re: How to switch Octane materials based on an attribute

Postby rustyippolito » Mon Apr 15, 2024 9:06 pm

rustyippolito Mon Apr 15, 2024 9:06 pm
Sorry for not thanking you sooner, that was EXACTLY what I needed to get over this issue. My materials are quite complex and i had a workaround that involved blasting between two complete sets of geometry with two complete sets of materials (ON & OFF). Your solution allowed me to do it all in the shader with very little troubleshooting. Now i can easily iterate on the changing group animation without having to rebuild my setup each time i make a change! Many thanks for your help:)
rustyippolito
Licensed Customer
Licensed Customer
 
Posts: 88
Joined: Wed Mar 08, 2017 10:07 pm

Return to Houdini


Who is online

Users browsing this forum: No registered users and 23 guests

Sat Apr 27, 2024 1:15 pm [ UTC ]