vex builder - alpha, opacity, and emission

   10952   5   1
User Avatar
Member
119 posts
Joined: 7月 2005
Offline
hi!…

can anyone help me out? i`m building a shader in vex builder and need it to have a transparency map attribute and able to render alpha from the texture too…

also i need to have an emission attribute… i cant figure out how to do it.. i`m assuming it comes after the lighting model somewhere?

cheers,

Mark
User Avatar
Member
49 posts
Joined: 7月 2005
Offline
To use an Alpha you need to multiply your exsisting Color and Transparency by the Alpha value before they go into Cf and Of. Generally, if you are not doing anything fancy, like a matte shader, you don't have to wire anything into Af, since it is by defualt the average of Of.

If you are using a Color Texture Map with an Alpha, ensure that you select RGBA Values as the Signature of your Texture VOP. You then need to convert from Vector4 to Vector, there will be two outputs, a vector and a float; The vector is your Color and the float is the Alpha.

If you are using the color component of your Texture, you will want to unpremultiply it before using it in your Lighting Model… this way you will avoid getting black edges. To unpremultiply you divide the Color by the Alpha.
Jeff Willette
Freelance TD
User Avatar
Member
7725 posts
Joined: 7月 2005
Offline
I've uploaded an example on the Exchange. I haven't tried it out yet but give it a whirl.

http://www.sidefx.com/exchange/info.php?fileid=192 [sidefx.com]
User Avatar
Member
119 posts
Joined: 7月 2005
Offline
hey.. cheers

i cant get the file, it says `file does not exist`

ive tried multiplying the output of the lighting model with a colour and then into the opacity but it doesnt work.. i get a strange effect but not what youd expect..
User Avatar
Member
49 posts
Joined: 7月 2005
Offline
If you are using the Lighting Model VOP you usually don't want to multiply the color output by another color unless you are trying to achieve a specific effect.

Any multiplying of colors should be done before the “diff” input on the Lighting VOP, including multiplying in your transparency color (transparency is different than Alpha).

Here is a typical flow for both Cf and Of with the use of the Lighting VOP:
  • Color = UserDefinedColor * TextureColor * Cf
    Transparency = UserDefinedTransparency * Of
    Alpha = TextureAlpha
    Color*Transparency–>“diff of LightingVOP”–>“clr from LightingVOP”*Alpha–>Cf
  • Transparency*Alpha–>Of

    Keep in mind that the VOP, viewer pane is often misleading, make sure to do test renders.
Jeff Willette
Freelance TD
User Avatar
Member
49 posts
Joined: 7月 2005
Offline
Emission:

Yes you would want to add the emission value to the color from your Lighting Model before it gets multiplied by the Alpha.

If you want your emission to be effected by your transparency, you would multiply them together before adding that to the Lighting Model result.
Jeff Willette
Freelance TD
  • Quick Links