Results 1 to 5 of 5

Thread: transparency and emission color

  1. #1
    Join Date
    Jan 2008
    Posts
    15

    Default transparency and emission color

    Hello,

    I am trying to implement a transparency scaler and emission scaler within Mental Mill. Any ideas?

    Thanks!

  2. #2
    Join Date
    Jun 2007
    Location
    Berlin
    Posts
    447

    Default

    Hello Mill Worker,

    Could you explain more precisely what you exactly mean, please?
    - You you want to have a shader were you are able to scale its transparency (=alpha) value between 0 (fully opaque) and 1 (fully transparent), right?
    - About the emission scaler: You want to add some color on top of your illumination node?

    Best Regards,
    Ruediger

  3. #3
    Join Date
    Jan 2008
    Posts
    15

    Default

    Hello ruediger,

    Correct, I am looking for a way to control the transparency of the shader via its alpha channel. I found a cgfx shader that does this and the emissive power, however I was unsuccessful in appending my shaders with snippets of that code.

    Attached are examples of the transparency and emissive features I am trying to copy (taken from a 'Default' shader in FX Composer.)
    Attached Images Attached Images

  4. #4
    Join Date
    Jun 2007
    Location
    Berlin
    Posts
    447

    Default

    Hi,

    it's best to build a Phenomenon to achieve this effect. I have attached an example of how to assemble the nodes that you need.

    Note: When you rename an interface parameter (=the input parameters on the left) of the Phenomenon, make sure to rename also the internal name: This is the name of the variable that is going to show up in FX composer (prefixed with the name of the Phenomenon).
    You can easily rename an interface parameter by right-clicking it and select "Rename '<parametername>' ".

    For the transparency, you have to hand-massage the generated output of the Phenomenon by adding the following lines into the pass statement (this is CgFX):

    Code:
    pass P0
    {
      ...
      BlendEnable = true;
      BlendFunc = int2(SrcAlpha, One);
      ...
    }
    Please read thread http://forum.mentalimages.com/showth...t=transparency for a detailed discussion of transparency.

    Best Regards,
    Ruediger
    Attached Images Attached Images

  5. #5
    Join Date
    Jan 2008
    Posts
    15

    Default

    Thanks ruediger, that helps quite a bit!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •