Results 1 to 3 of 3

Thread: Can hair opacity be set by its geom shader?

  1. #1
    Join Date
    Oct 2006
    Posts
    1

    Question Can hair opacity be set by its geom shader?

    I have a geom shader which is creating hair (mi_api_hair_begin(), etc) and I would like to have the opacity decrease toward the tip. I can do that using a custom shader, but I'd like to handle it in the geom shader so that any normal MR shader can be applied to the hair and will automatically get the correct opacity values.

    I can store opacity values easily enough using a per-vertex user scalar, but normal MR shaders will just ignore that.

    Any ideas on how I might go about it?

    Thanks.

  2. #2

    Default

    Deane, storing the opacity values as user data or texture sounds like a good idea if you need such fine control over opacity.
    The base hair shaders simply look up the barycentric coordinates when determining opacity, they do not look up user data.

    Quote Originally Posted by deane View Post
    I have a geom shader which is creating hair (mi_api_hair_begin(), etc) and I would like to have the opacity decrease toward the tip. I can do that using a custom shader, but I'd like to handle it in the geom shader so that any normal MR shader can be applied to the hair and will automatically get the correct opacity values.

    I can store opacity values easily enough using a per-vertex user scalar, but normal MR shaders will just ignore that.

    Any ideas on how I might go about it?

    Thanks.

  3. #3
    Join Date
    Dec 2004
    Location
    Marina Del Rey, California
    Posts
    4,143

    Default

    Which hair shaders are you using?

    A utility shader could also be used to feed the transparency input for example?

    That utility shader could look up your data, or the barycentric coords. Note that for hair, the barycentric become an indicator of point along hair length and width distance from middle.
    Barton Gawboy

Tags for this Thread

Posting Permissions

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