sequence rendering

laverdet_943f1f7da1laverdet_943f1f7da1 Posts: 252
edited December 1969 in Carrara Discussion

Hello! what is, rendering in png sequence, and checked "render alpha channel", the purpose of "use premultiplied alpha"???

Comments

  • wetcircuitwetcircuit Posts: 0
    edited December 2012

    **EDIT -- THERE WAS A BUG BUT IT HAS BEEN FIXED **

    Alpha channel is very basic. It is on or off. It does not respect shader-based transparency, only geometry-based (which technically is not "transparency" it is simply where there is no mesh...) If you are rendering an animation you will see that Carrara does not bother to render the empty areas. This can be much faster.

    Premul Alpha allows partial (semi-) transparency using a method to blend the transparency with an under-layer or background. The issue is that that to get the best quality, you need to render over a similar color as your background....

    For example: If I want to render a model which has a transparency map in the hair, I will get BETTER blending if I know that I will be compositing into a bright sunny scene. I should render the figure over a light colored background simillar to the colors in the background image.... My compositing program (Photoshop, AfterEffects) will be able to blend the transparency better using the "premultiply" method.

    Pre + Multiply: you have specified a color in advance when you created the transparency information, which the compositor will use to mathematically blend the images.

    So Premul Alpha is "better" because it has more detailed information, but it may not be appropriate for all uses. Sometime straight Alpha is more efficient and more universal....

    Post edited by wetcircuit on
  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 2012

    Holly, if I read your post correctly I think you have some basic misunderstandings of alpha and premultiplication...

    Alpha channel is not "on or off", it is a value. Usually between 0 and 255, and describes the transparency of each pixel. So what is stored in the file when you save a rendered image is, for each pixel, a number for each of the RGB values, and a number (between 0 and 255) for the transparency (alpha) of that pixel.

    All pre-multiplying does is 'pre-multiply' the alpha value for that pixel before it's saved with each of the R, G, and B values for that pixel.
    So for example, if you had a pixel that was fully red (R=255) at 50% transparency, a 'straight' alpha saved image would give you (RGBA) values of (255, 0, 0, 127) for that pixel. Fully red (255) at 50% transparency (127)

    However, if you choose to pre-multiply, the saved pixel info for that image would be (127,0,0,127), because you pre-multiplied the pixel's transparency with the RGB values.

    Both methods, BTW, give you exactly the same, correct, info about each pixel. Both methods give a 50% transparent red pixel. They just do it differently.

    Now, the benefits of both alternatives depend. And which is 'better' depends, and you may find out that neither is better, just different. I would suggest you do some reading on the implications to see if it even matters for the work you're doing. If you're doing a lot of compositing you might choose to pre-multiply, and for color correction you might chose not to, but it really depends.

    However, and this can be real important, sometimes it also depends on what software you're using, and what it's expecting for how incoming images handle alpha.

    Post edited by JoeMamma2000 on
  • wetcircuitwetcircuit Posts: 0
    edited December 2012

    Holly, if I read your post correctly I think you have some basic misunderstandings of alpha and premultiplication...

    Alpha channel is not "on or off", it is a value. Usually between 0 and 255


    Not in Carrara. Since there is no way to have partial transparency without a shader, the end result of checking "Alpha Channel" without "Use Premul" is an alpha that's either on or off, determined by the mesh.

    Celmar is not a native English speaker, but I took his question to be specific as to the difference in these two settings in Carrara.

    Post edited by wetcircuit on
  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    I'm cornfused...

    Why are you making a distinction between shader-based and non-shader-based transparency? Are you saying Carrara only assigns an alpha (0-255) value to a pixel if it is a pixel that was rendered for an object with a semi-transparent shader? And if so, so what? How does that affect the premultiplying issue?

    I'm totally cornfused. :)

  • wetcircuitwetcircuit Posts: 0
    edited December 2012

    I'm cornfused...

    Why are you making a distinction between shader-based and non-shader-based transparency? Are you saying Carrara only assigns an alpha (0-255) value to a pixel if it is a pixel that was rendered for an object with a semi-transparent shader? And if so, so what? How does that affect the premultiplying issue?

    I'm totally cornfused. :)


    I guess I am saying it in a confusing way... Let me try to be more clear.

    There are TWO separate and distinct functions:
    1) Carrara renders the frame
    2) Carrara outputs the frame to the file format you have chosen

    For part 1, the transparency controls are under the RENDERING TAB (along with Bump, Refraction, Shadows, etc).

    For part 2, the controls which Celmar asks about are located under the FILE TAB, FILE FORMAT

    (see pics below)
    _______________________________________________

    After choosing an output format like PNG which can contain alpha information, you have three options:

    Render Alpha Channel (unchecked)
    Use Premultiplied Alpha (unchecked)
    (passes no alpha information to PNG)
    ________

    Render Alpha Channel (checked)
    Use Premultiplied Alpha (unchecked)
    (passes only mesh alpha to PNG)
    ________

    Render Alpha Channel (checked)
    Use Premultiplied Alpha (checked)
    (passes BOTH mesh alpha and shader alpha to PNG)
    ________

    This is a quirk of Carrara. To get shader transparency passed to the output file format, you must have both alpha options turned on.

    Screen_Shot_2012-12-20_at_4.09_.37_PM_.png
    237 x 444 - 41K
    Screen_Shot_2012-12-20_at_4.09_.10_PM_.png
    239 x 336 - 37K
    Post edited by wetcircuit on
  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    Okay, I guess I still don't get it.

    I render an image of a sphere that has a shader with 50% alpha. I DON'T select pre-multiplied. I bring the image into, say, Photoshop. The sphere appears 50% transparent, as it should.

    What am I missing?

  • wetcircuitwetcircuit Posts: 0
    edited December 2012

    Okay, I guess I still don't get it.

    I render an image of a sphere that has a shader with 50% alpha. I DON'T select pre-multiplied. I bring the image into, say, Photoshop. The sphere appears 50% transparent, as it should.

    What am I missing?


    Ahh! Perhaps it has changed! This is very good news! :wow:
    I will have to check...

    YES! You are right!! It has been fixed!!! :coolsmile:

    Post edited by wetcircuit on
  • RoguePilotRoguePilot Posts: 239
    edited December 2012

    Sorry to but in,

    but

    Premultiplying refers to how the RGBA data and is encoded and is useful for colour blending at the edges of the transparent area.
    The alpha value is used to fade the saturation of the pixel colour in proportion to the transparency. This is encoded into the image file.
    The non-premultiplied format leaves the colour data untouched. Pre-multiplying is actually slightly destructive of the colour information but does produce a nicer edge.
    In a renderer, pre-multiplying also multiplies by the background colour so that you can colour match to the background that you're compositing onto. I often render a quick low res image of my background props to drop into the scene backdrop. This gives me a very clean edge if I want to render seperate components.

    Holly, I know you have issues with transparencies on PNG files so the way you are seeing the output may be a symptom of that.

    I use a PC. For me the shader alpha values are always respected in the final image alpha channel, whether pre or non-pre multiplied, I use them extensively to create masks for use in Photoshop. The shader transparency channel is not simply the inverse of the shader alpha channel and must be treated differently (as I worked out after a few frustrated tries when I first started using Carrara).


    Edit....

    Ok I just saw your edit and last post so never mind (I had this open for a while before posting).
    I'll leave this on for the sake of it though.

    Post edited by RoguePilot on
  • wetcircuitwetcircuit Posts: 0
    edited December 1969

    Holly, I know you have issues with transparencies on PNG files so the way you are seeing the output may be a symptom of that.

    LOL it was a very old bug from the Eovia days... Carrara3 or 4 (if not earlier)... I have no idea when it was fixed as I'd just trained myself to stop expecting it. LOL!

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    Um...okay...I guess with all of that I'm not sure where that leaves us. Seems like Rogue pretty much repeated what's been said, and then there was something about an Eovia bug.

    Do I need to revise my understanding of how Carrara handles alpha/premultiplying, or....?

    Bottom line, I'm assuming that Carrara correctly generates an alpha channel for any transparencies, including shader alphas, any effects you use (volumetrics, light effects, etc.), backgrounds, etc., and either simply premultiplies them or not, depending upon whether you check the box.

    Is that about right? Or is there something Carrara does that's not that straightforward?

  • wetcircuitwetcircuit Posts: 0
    edited December 1969

    Um...okay...I guess with all of that I'm not sure where that leaves us. Seems like Rogue pretty much repeated what's been said, and then there was something about an Eovia bug.

    Do I need to revise my understanding of how Carrara handles alpha/premultiplying, or....?

    Bottom line, I'm assuming that Carrara correctly generates an alpha channel for any transparencies, including shader alphas, any effects you use (volumetrics, light effects, etc.), backgrounds, etc., and either simply premultiplies them or not, depending upon whether you check the box.

    Is that about right? Or is there something Carrara does that's not that straightforward?


    That is correct... Our misunderstanding came from me assuming a very long standing bug had never been fixed.... It was one of those super old bugs that everyone simply passed along the knowledge (it was before DAZ owned Carrara). I have used Premul as a workaround for so long that I haven't tried without...

    This is GREAT news for me. I have always hated using premul. LOL

    Apologies for derailing the thread...%-P

  • cdordonicdordoni Posts: 583
    edited December 1969

    ... assuming a very long standing bug had never been fixed....

    Perhaps you are onto something, expect a bug NOT to be fixed, then be pleasantly surprised many years later when you find out is was fixed.

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    The bug must have been fixed with C5, because that's when I started with Carrara and the alphas behaved as I expected. The only problem I had, was expecting the transparency channel to act as an alpha channel as it did in Raydream. Once I discovered the shaders had a separate alpha channel in addition to the transparency, then all behaved as expected.

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    Hold on, it just occurred to me...

    You guys are talking about shader alpha channels and transparencies, and I'm thinking solely about RENDERED IMAGE alpha channels. Two completely different things, right?

    The shader alpha and transparency info (plus the highlight, bump, etc.), is an INPUT to the renderer, while the rendered image and its alpha channels are the RESULT, and the OUTPUT, of the render process. And in the rendered image the ONLY info that gets sent to the file, is, for each pixel, the RGB and alpha values for that pixel. That's it. Well, unless you add output channels/passes, like depth passes, etc.

    So if we're talking about alpha and premultiplication of rendered images, the shader alpha/transparency is totally unrelated, right?

    Well, except that it was involved in deciding how each pixel would ultimately appear in the final render, but that's a separate issue.

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    I had read the original post that Holly had written as saying the Render Alpha channel option only respected the geometry of the rendered object, and not any transparent shaders unless the Pre-multiplied option was checked as well.


    To get your example of a sphere to appear at it's 50% alpha value in Carrara, you'd have to use that function in the shader as well as have the option checked in the render room. To me they go hand in hand.


    I use the straight alpha option and the pre-multiplied option for different needs. Most of my space based animations are composited and I tend to use the straight alpha for those, so I can state with certainty that objects with alphas in their shaders, no matter the value, render properly- As do the renders where I've selected the pre-multiplied option.

  • wetcircuitwetcircuit Posts: 0
    edited December 1969

    Hold on, it just occurred to me...

    You guys are talking about shader alpha channels and transparencies, and I'm thinking solely about RENDERED IMAGE alpha channels. Two completely different things, right?


    Yes, we were both confused about two different parts of the same topic. LOL!

    Welcome to the SPECIAL HELP forums. LOL! Ask your questiona nd get long-winded wrong answers. HAHAHAH!

Sign In or Register to comment.