bdancer/vb25 — Issue #57: opacity textures should use alpha channel
Author: nizu
Created: 2011-11-25 11:55:22+00:00
State: open

The opacity textures are behaving not as expected :

when i assign a bitmap texture to alpha , the alpha channel is used ( "out_alpha" )

I'd expect the same behaviour when using the texture for opacity . But currently VB uses "out_intensity"

Example : creating the material for a tree leaf. i have a bitmap with the leaf color and alpha , if i use 'refraction' it works , i can assign the bitmap to "color" and "refract" and get a correct result.
But if i use "opacity" i need another texture with a B/W mask for the alpha ... it'd be easier if could use the alpha channel of the color image, as it works for refraction.

I tried to change the exporter , and got half way : i replaced "out_intensity" with "out_alpha" here :

line 703 , BRDFVrayMaterial.py :
if 'opacity' in textures:
ofile.write("\n\topacity= %s::out_alpha;" % textures['opacity'])

But it's not enough ,when writing the stack (texlayered) i still get a base color (1,1,1,1) , then the texture.
To make it work the base of the stack should be the opacity slider of the material (or be transparent : 0,0,0,0 )

I'll see if i can solve that coding bit and propose a fix , but i'm a bit stuck on changing that base color , Thanks !