A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
Compositing Question (Maybe Related to C4D)
Posted: 07 January 2013 09:00 PM   [ Ignore ]  
Avatar
Total Posts:  39
Joined  2012-03-21

Hello all,
Happy New Year to everyone. I’m trying to get to the bottom of something here, specifically dealing with compositing. I’m not sure if the problem is that I’m missing a trick in Cinema that would make my life easier, or if there is a fundamental issue I’m overlooking. I’ve had this reoccurring problem with my mattes and I can’t figure out how to solve it. Basically, when I render out objects I get a one pixel fringe on my matte, which doesn’t seem to make sense (and is the opposite of useful). When I render to PSD, TIFF, EXR, PNG, I get this fringe. What’s weird is that only under circumstances am I able to get the fringe to go away. I came across one completely by accident — I was practicing some tips and tricks using multipass compositing and I got it to go away. The problem is, the only way I was able to get it to disappear was via a GI pass comped into AE. Weird, eh? So let’s say I want to comp this Weyland logo into a background. I certainly wouldn’t want the white fringing that is the result of the matte. So the question is, what’s the way to solve this problem without having to render out multipass images? (So I could just use an RGBA image if I wanted to, because that problem occurs there too).

1] When I have my GI layer turned off, I get the weird 1 px fringe.

2] When GI is turned on, the fringe goes away.

Now, my GI is set to “Add,” which further confuses me why there is a fringe when the layer is turned off (shouldn’t it be the other way around??).

Profile
 
 
Posted: 07 January 2013 09:33 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Kobold Studio,

Would it be possible to share the project file, perhaps replace the logo with some primitives, but REALLY use the same project file, so I can see your render settings. I need also to “see” your compositing approach, what is finally in all these adds/stencils/darken. Not something that looks similar to my way of using Ae (not a critic!). The Ae file might help as well, to see how your idea is about to compose this. Please check if you get with the files the same problem before you submit them. What versions do you use C4D and Ae.

The fringe in Ae, is most of the time based on “Gamma vs Linear”. If it is really a one pixel and smooth phenomenon. I can’t really tell the images are to low res on the important parts. If they were jaggy or staircase based I would thing about Premultiplied/Straight problems. Perhaps it is something new. Sometimes it is the Shadow Correction (which would be different in GI compared to Standard). Many options inside of a pipeline, I’m open for surprises there, no question.

Again, not a new file, which might be useless.

If there is something with the GI vs standard rendering, that would be a case for the Support, which we are not supposed to do here.

All the best

Sassi

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 07 January 2013 09:38 PM   [ Ignore ]   [ # 2 ]  
Avatar
Total Posts:  39
Joined  2012-03-21

After toying around for half a day and then posting in a few forums, I believe I came across the problem — straight alpha channels. I have to do a few more tests, but I think the problem is solved by using a separate alpha!! More on this hopefully by tomorrow.

Cheers, Sassi. As always, thanks for the quick response!!

Best,
Mike

Profile
 
 
Posted: 07 January 2013 09:57 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hey Mike,

Straight Alpha is great for post production. The idea is to keep the complete color information even for edge pixels. In more or less complex compositing there is an option to create some trouble…

Have an eye on the “nature” of the edge, if it looks more staircase like, it indicates a premultiplied/straight problems. If it is a nice one pixel line, relatively smooth, it indicates more an linear/gamma problem. Well, or both.

Alpha channels are the most underestimated problem source in Ae (I use Ae since r3.1). Even in NUKE, where the options are way more flexible, one might into trouble if premultiplied material is used instead of straight and vice versa. It is just a common thing.

Try to build up (just for the sake of test) your composition without “Stencil”. I never use this and so I have this one under suspicion - perhaps I’m wrong, as I have no idea about the content that you have there.

Good luck

Sassi

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 08 January 2013 02:36 PM   [ Ignore ]   [ # 4 ]  
Avatar
Total Posts:  39
Joined  2012-03-21

Sassi,
Turns out everything was certainly related to the “Straight” vs “Separate” alpha. With my separate alpha, everything is working smoothly. I’m a bit surprised that the two options would result in such a drastic difference, but then again, I don’t really understand the math between the two.

Thanks again for the added info!!

Cheers,
Mike

Profile
 
 
Posted: 08 January 2013 03:53 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hey Mike,

You’re welcome.

In short it is all about the four values R, G, B and A and how they are stored or created. For any color-correction you need full RGB values, no A. For any compositing work you need RGBA values. How all of that is created is critical. Not really complicated, but it needs care, and zero tolerance with color profiles/linear/gamma stuff. There is the problem.


The longer version:
Premultiplied has the transparency information in the pixel, pre stands here for already mixed into it. To work with the RGB values, the transparent part needs to be known, to re-create just RGB only values—if you like to perform for example a color change. So border pixel and “inside/surface” pixel become treaded in the same way. Otherwise the border/edge has a color shift.

Straight leaves all RGB values as is, even (a little bit) beyond the object border. If an object in Straight even “touches” a little bit an area of an pixel, the RGB information is completely rendered. The transparency is in an alpha or mask pass separate available, and is only applied if needed.

In both cases, you need all four values RGBA each time - if the compositing should work nicely.

The problem starts, if the alpha information is applied again to a premultiplied image (double transparency) or if the alpha information is pulled out wrongly from an premultiplied image. Will say, if the image had an linear alpha and you pull out an alpha that is gamma based (vice versa) things screw up.

As premultiplied images can be multiplied against black or white (other colors are possible, but not common), a wrong de-premultiplication can make that color (black or white for example) visible. Jeremy Birn has a nice Photoshop set up to illustrate that problem. (Jeremy Birn 2nd edition, page 345-347). He puts the alpha information as a layer mask to a black layer (RGB=0;0;0). On top of that layer the image set to linear dodge (add). The book is a little bit old by now (I miss a lot the linear workflow in it, and I hope the third edition is in work ;o), but many books cover that theme, especially NUKE based compositing books. Other sources, in which I highly trust (since nearly a decade) are Steve Wright Books, or Ron Brinkmann (Both are a must have from my point of view, if someone dives deep into compositing.

Besides that, in my multi-pass series I went into that theme relatively detailed, here on Cineversity.

I think to be aware off it and to be able to read the signs when things went wrong is certainly a big first step. To go through it until certainty is achieved, is with no doubt the way to go: It helps to getting deadlines done with less stress ;o)

Good luck with the project

Sassi

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile