Page 1 of 1

How to switch Octane materials based on an attribute

PostPosted: Sat Mar 23, 2024 11:35 pm
by rustyippolito
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:)

Re: How to switch Octane materials based on an attribute

PostPosted: Sun Mar 24, 2024 11:28 am
by galleon27
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.

Re: How to switch Octane materials based on an attribute

PostPosted: Mon Apr 15, 2024 9:06 pm
by rustyippolito
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:)