Announcement

Collapse
No announcement yet.

OSL transparent() alpha issue?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OSL transparent() alpha issue?

    Hi all,

    I just came across the problem where my OSL material shader alpha didn't have the value I expected it to have. It seems that to get the correct value with transparent you need to multiply with with the square root of the intended value.

    This will get you an alpha of 0.5.
    Code:
    surface
    testalpha
    (
    )
    {	
    	Ci = transparent() * sqrt(0.5);
    }
    However this will give you an alpha of 0.75 (1 - 0.5 * 0.5).
    Code:
    surface
    testalpha
    (
    )
    {	
    	Ci = transparent() * 0.5;
    }
    Is this doubling unintentional or something I've missed?

    Thanks!
    Rens Heeren
    Generalist
    WEBSITE - IMDB - LINKEDIN - OSL SHADERS
Working...
X