Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualDanicco

Posted 24 August 2013 - 06:48 PM

Hmm I think I got it, I just added an 

if(color.w == 1)
{
    color.w = alpha; //the value I sent
}

I've read that if statements should be avoided in the shaders but I couldn't think of any other option, is there any better way to do this?

 

Edit: Also, this made me wonder... I had to create a separate programID that receives the alpha and uses it for the fading effect, but what am I supposed to do then if I have an object with a material type of Y (a specific shader) and I want to add this fading effect to it? (Like those effects of characters going stealth)

 

Am I supposed to create each of these effects plus an alternative version for the alpha effect?


#1Danicco

Posted 24 August 2013 - 06:43 PM

Hmm I think I got it, I just added an 

 

if(color.w == 1)
{
    color.w = alpha; //the value I sent
}

 

I've read that if statements should be avoided in the shaders but I couldn't think of any other option, is there any better way to do this?


PARTNERS