Announcement

Collapse
No announcement yet.

Lens effects alpha contribution

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

  • Lens effects alpha contribution

    So do lens effects not contribute to the alpha channel?

  • #2
    Hi,
    The alpha channel is not affected by Bloom and Glare effects. Since the Lens flare effects use the RGB channel to generate the effect as a post process to the final render, the alpha remains untouched.
    Tashko Zashev | chaos.com
    Chaos Support Representative | contact us

    Comment


    • #3
      Shame, that makes it useless for rendering sprites for games, which is what I'm doing now.
      The lens effects seem a bit half finished, a bit of an afterthought. I've noticed that lens effects in the 3dsmax version of Vray seems more fully featured. Does the max version support writing to the alpha channel? Are there any plans to bring Maya lens effects up to the standard of Max lens effects?

      Comment


      • #4
        I doubt that writing to the alpha channel is something desired. These are camera lighting effects, they don't have something that can be called alpha. You can render them to render elements, and then generate alpha for them in a way that works for you.
        V-Ray/PhoenixFD for Maya developer

        Comment


        • #5
          I can tell you for sure it's "desired" by one person at least. Other (most) programs write lens effects to the alpha channel. Currently I'm rendering the model in vray and adding efects in Autodesk composite. (Which writes glows etc to the alpha channel).

          What do you mean "generate alpha for them in a way that works for you." Can Vray generate the alpha somehow then?

          Comment


          • #6
            Alpha channel for lens effects doesn't make much sense to me.
            If you had one I guess it would looks pretty similar to the luminance of the actual effect, so I think Ivaylo means you could use the rgb in the lens effects render elements as an alpha.

            But you would get half transparent pixels mixed with the background color (probably black) and it could look pretty strange on different colored backgrounds afterwards.
            A glow effect or such should be used as an add/plus operation, just adding the additional pixel values on top. That means an alpha doesn't have any effect, which is why there is no alpha I assume.
            CG Artist - RnD and CG Supervision at Industriromantik

            Comment


            • #7
              "mixed with the background color (probably black)" Is where you're mistaken.

              There is no background colour on a transparent image. If you look at the images that other software produces there is no "mix" of background colour and "glow". There is no background colour to mix. The lens effects contribution is full RGB of that colour contribution which is faded out by the alpha.

              Comment


              • #8
                Well. Thats the same as an unpremultiplied image, then being premulted in say photoshop (which does this automatically).
                But having the unpremultiplied version of the lens effect on the beauty render would look very strange (almost all white everywhere). However I guess the render element could in theory be the unpremultiplied lens effect, with an correct alpha. Opening this image in photoshop would make it look correct as you're describing it, however opening it in for example Nuke would look strange until you premult it (which is no big deal, but kinda odd to have to do before using it in the comp).

                Those things aside, im pretty sure that you could use the luminance of the lens effect element as an alpha, and then unpremult that result. Opening that image in photoshop should look correct or close to.

                But maybe im not understanding you completely yet.
                CG Artist - RnD and CG Supervision at Industriromantik

                Comment


                • #9
                  I need it for sprites and glowing UI elements in games so it would be nice if it worked out of the box. I could use the luminance of the RGB as the Alpha, but then you do run into the multiplication problem (unless I'm missing something) and it's probably just quicker for me to do it in some other software.
                  Just seems like a really sloppy oversight and makes lens effects useless in Vray for any image you intend to use as part of a composite.

                  Comment


                  • #10
                    Yes, you would need to have to unpremult it (but keep the alpha) to avoid the multiplication problem.
                    I dont agree with you that it seems like a sloppy oversight that makes it useless for compositing. But rather the opposite. If it affected the alpha that in itself would make it useless for compositing.
                    But perhaps an "affect alpha" checkbox in the Lens Effect editor would please both our needs.
                    CG Artist - RnD and CG Supervision at Industriromantik

                    Comment


                    • #11
                      Hmm, I'm confused. How would you composite a glowing object (A lightbulb lets say) as a foreground element in a scene if the glow didn't contribute to the alpha?
                      The lightbulb itself has opaque and semi opaque alpha, but the glow is invisible. How do you get that to look correct in a scene?

                      Comment


                      • #12
                        Well, the element would be against black. So it can simply be added (Linear Dodge in Photoshop, Plus in Nuke, Add in After Effects (I think?)) on top, just like any other render element you use to build your beauty out of.
                        I dont have a render with lens effects to show you, but this is how you do it in Nuke atleast.
                        The left image is me making a glow effect against black, similiar to how such a render element would work. It also has a completely black alpha. Middle image is that result simply merged on top of that with a plus operation. Photoshop would give you the same result with Linear Dodge. Right image is how it looks in the node tree when its merged with plus.

                        Click image for larger version

Name:	nukeGlowMerge.jpg
Views:	1
Size:	154.9 KB
ID:	860030

                        If the glow effect on the left had alpha, this wouldnt affect the plus/add operation at all, so that would be fine. However you quite often wanna use the alpha in your render to change the background image or something like that, and if the lens effect added white gradients in that, that would suddenly screw that whole workflow up a ton.
                        Also, changing the consistency with all render passes that builds up the beauty image should be added together to recreate it, except for the lens effects which should be placed on top with a normal/over operation, would be pretty strange and confusing (and also probably not correct as that would clamp the values and get rid of the pixels values behind the glow effect that has an alpha set as white or close to white, rather than being a light/lens effect thats added on top of the result.
                        Attached Files
                        CG Artist - RnD and CG Supervision at Industriromantik

                        Comment


                        • #13
                          Thanks, obviously you don't have that kind of control with a sprite or UI element in a game. Also you only get one layer. With what you've done there, you'd obviously need more layers for any objects that weren't actually glowing, like the bulb itself, or the housing; anything that was just alpha blended.

                          With anything realtime, efficiency is everything so you want all the data in one bitmap. So maybe a checkbox would be best...

                          Comment

                          Working...
                          X