Jump to content
Sign in to follow this  
OdForest

Add color to existing color based on attribute?

Recommended Posts

Posted (edited)

Hi!

 

So I have this grid who has colours from a from a noise, and then I make them lines and jitter them. 

I have made an attribute on it called 'eye'. And I want at the end of the chain to color my object a predefined red (color vector) where the 'eye' attribute is 1. And I want this on top of the existing color, which is what I don't know how to do.


How can I layer different colours on top of each other based on attributes in VEX and in VOPs (or any other way)?

AddColorToExistingColor.hipnc

 

Thank you! :) 

Edited by that Abstract guy

Share this post


Link to post
Share on other sites

not sure if that's what you're after, but use one of these lines to see different effects

//if(f@eye>0) @Cd = {1,0,0}; //overrides the color where @eye is 1
//if(f@eye>0) @Cd += {1,0,0}; //add red where @eye is 1
if(f@eye>0) @Cd *= {1,0,0}; //multiply with red where @eye is 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Ah I see. And how would you do it if you want it like a gradient? Or lets say: like an override, but only overridden 50% wherever the attribute is 0.5?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×