Best way to do bluescreen?

I discovered the blue-screen plugin. :o Certainly makes my rendering work a lot easier, because I can render the static parts of my scenes with just one .jpg, shoot the moving pieces against a bluescreen (world background), and composite them together with this sequence-editor filter.

My question is, isn’t there an even-better way to do this? I see the “alphamatte” filter for example and see how it could be used to make a mask. I see some “jaggies” (aliasing) on the border of close-up composites. And I’m just sure that there must be an even-better way to produce these composites in Blender. To spare my forehead more abuse (“whack! whack!” Doh!) I thought I’d just ask.

I’m also wondering if it’s possible to do “shadow passes” in Blender where you produce, say, a layer that contains only the shadows.

Render with an alpha background (transparency) and use the alpha over effect directly instead.

Martin

Thank you. Now, would you kindly elaborate in detail? :-? I know more-or-less what needs to be achieved but it’s not obvious how to do it.

“AlphaOver” basically didn’t have a mask to work with, at least not with the buttons I pushed. It couldn’t combine the images; it was one or the other. I tried various combos of that with no success before looking for a plugin.

It’s in my compositing tutorial. Here’s the relevant part:

Press Key in the Render buttons. Render a still picture, with no motion blur. You can do this because the monkey isn’t going to move at any point during the video, so you can just use a still frame. Press RGBA in the Render buttons and save as a PNG. (If the monkey was moving and you were rendering an animation, you would render to a sequence of PNGs.)

http://www.weirdhat.com/blender/compositing2/screenshot11.jpg

Now that’s puzzling… I already tried RGBA and so-forth, although I am rendering to AVI-Jpeg. What I found is that the blue world-color apparently had alpha so nothing showed through. So did a jet-black color (0/0/0).

Reading the tutorial you cite, I focused on the preceding paragraph:

First, select the background plane, and go to the Material buttons. Press “Env” in the Mirror Transp panel. This makes it so that the background plane will render transparent to the background color, but still obscure anything behind it. Go to the World buttons and set HoR, HoG, and HoB to 0.

Could that, the bold-faced text above, be the “magic” I’m looking for?

The differences between your approach and mine appear to be: (a) you have an explicit background-plane; and (b) you fiddle with the ‘Env’ setting. Is the ‘Env’ setting significant to my problem?

If it doesn’t, then I guess I still don’t understand. :expressionless: You see, I did try both a blue and a zero-black World background color. I did set RGBA. And I tried all sorts of ways with AlphaOver. What I consistently found is that the entire overlay-picture was treated as containing alpha, so the output always consisted only of the … overlay picture. There was no masking taking place.

I also read, in the same tutorial:

Go to the Texture buttons, and add a new texture. […] Press “UseAlpha”. Then go back to the Material buttons. Decrease the Alpha of the material to 0, and press “Alpha” in the Map To panel. Press “ZTransp” in the Mirror Transp panel.

Once again, you’re doing a lot of magic here with stuff like UseAlpha, Map-to-Alpha, and ZTransp and, frankly, whizzing by this stuff at such speed that I perceive that what you’re doing works but you do not pause to really explain why. I feel that there is some very essential ingredient in your soup that is missing in mine, without which things simply do not work, and I have not yet reached that “ah hah” moment…

Please elaborate even more. Thanks very much in advance.

It sounds to me (though I can’t be entirely sure) like your problem is that AVI JPEG doesn’t support alpha. That’s the reason I render to PNG sequences, because PNG supports alpha.

I’m pretty sure that the rest of the stuff you said isn’t relevant to this problem, though it may be relevant to the animation you’re making in other ways. The Env setting essentially just makes the background plane invisible, which isn’t a problem if you don’t have a background plane in the first place.

I can certainly try other formats. What I was zeroing in on was the comment about “setting alpha to zero,” because I wondered if this was somehow necessary to cause the alpha of the “blue” bits to become zero. I still do not have any definitive clue whether or not the background (world) color contains Alpha=1.0 or Alpha=0.0, or is adjustable.

It may well be that the problem is with the format, and I will investigate that. (Obviously, something is interfering with my experiments because the results are certainly not consistent.) Casual Googling of various sites suggests, by the fact that they mention “alpha channel” separately, that the AVI_Jpeg format may well not support it.

My head-banging so far definitely suggests that, to the Sequence Editor, Alpha=1.0 in every input I’m providing…

If I’m going to switch formats here, at least for inputs, which is the best? PNG, or TGA?

Maybe we should expand this topic, or start a new one, about which formats are best to use here. I’m shooting for DVD, and I am compositing.

What blue-screen plugin,from where?

From the Blender Plugin Repository:
http://www-users.cs.umn.edu/~mein/blender/plugins/
which I found from the Resources page, Download section, of the Blender3D.Org web-site at:
http://www.blender3d.org/cms/Resources.181.0.html#569

I’m expecting to find (rendering still in progress…) that once I have an Alpha channel working, that the AlphaOver built-in effect in the Sequence Editor will produce superior results because it does have Alpha. Alpha is a number with a range, say 0-255. With blue screen, the blue is either there or it isn’t (1 or 0), which leads to sharp edges that are more or are less objectionable depending upon the situation. (Although I’m also peering at the source-code to that plugin and considering how anti-aliasing might be added to it.)

I can see advantages to both of these procedures.

Success!

I found that the AlphaOver filter did work, and did produce superior results in close-ups, when output was rendered in Targa format with the RGBA button pressed. (Note: I didn’t bother to experiment with what would happen if the button were not pressed, since I expect it wouldn’t work.)

I conclude that the AVI-Jpeg format does not capture Alpha information.

I presume that PNG also does, and don’t know which one is better, PNG or TGA.

When output is sent to this format, each frame is rendered as a separate .tga file. So I put each shot into a separate directory. In the sequence editor, I add the strip as Images, not Movie, and selected all the files in the subdirectory by specifying *.tga in the file-selector window.

I achieved masking effects in several ways: - I do not yet know if the World color contains Alpha or not… It’ll be very handy if it does, but if not, see bullet point #3. - I set Alpha=0 of the materials that are in the foreground. They disappear, and become a perfect mask of their own shape. (Naturally, I have a separate copy of the .blend file, one for each layer!) - I’m also using scrim planes with a material, suitably called BlueScreen, which has Alpha=0. These scrims, placed in front of objects that would otherwise appear, mask them away perfectly.

(For completeness of explanation: “Alpha” denotes “transparency.” Alpha=0 is fully transparent, Alpha=255 is fully opaque, and Alpha=128 is a ghost. The AlphaOver (and similar) effects in the Sequence Editor combine layers using this Alpha information. In my setup, the foreground objects sit on a mask area having Alpha=0 while the objects have 255, or some value thereabouts.)

if youre doing something thats big enough for dvd, dont you have access to editing/compositing programs? just render each plate independantly, then composite in another program.

Ok I think you are talking about the chromakey_rgb plugin. You called it blue screen that is what had me confused.

As discussed here, the AVI 2.0 file format specifications, as defined by the openDML committee does not mention implementation of alpha channel. However, some software implement and support an additionnal 8 bit alpha channel in the video stream in raw AVI (uncompressed video data). This streches the video stream and cause image skewing in software that do not support it (like Blender). I haven’t found any docs on how such a format is implemented and how software supporting it separate it from standard 24 bit RGB files, but I assume its pretty straight forward and mainly a matter of reading the first chunk of data and seeing if it fits either.
I have yet to find any AVI codecs that implement an alpha channel, but I haven’t looked much either.

  • If anyone is interested, you can get the 1996 openDML specs here

I presume that PNG also does, and don’t know which one is better, PNG or TGA.

AFAIK, PNG offers better compression. Both are lossless, so compression, I think, is pretty much the only factor involves as far as your problem goes.

Martin

Smack! Doh!! Compression. Of course!

I was sending output to AVI-Jpeg format, which is a lossy compressed format. If such a format did have Alpha, and did not compress this data properly along with the RGB, it would never match-up, would never “register” with the RGB information on playback. So that might well be why it doesn’t.

Anyhow, both .TGA and .PNG appear to be doing the job beautifully, as long as the RGBA button is pressed.

Yup.

PNG and Targa are lossless formats. PNG compresses better, but isn’t supported as well as Targa.

Have you tried saving it as a .mov file, using the animation codec?

Blender also has an editor with compositing abilities. There’s a tutorial on this:

https://blenderartists.org/specials.php?id=2

This should point you in the right direction.

This is rather unrelated, but where do you get the bluescreen plugin? I think that would be a nice thing to have.

Random

The bluescreen plugin, actually chromakey_rgb, is found on the blender3d.org site in the “Download…Resources” section as previously described. The “Blender Plugin Repository” contains this and much more.

To recap:

  • Boy, did I wish I’d found that compositing tutorial just-mentioned, sooner! :o (It’s a “special” and I’ve never yet explored those, so I never found it before.) - I found that the best results are obtained by sending the output to .tga files (or .png), and clicking on the RGBA button when rendering. This produces output files with “Alpha” information. The built-in AlphaOver filter then does compositing. - The advantage of this technique is that it’s more versatile than blue-screen. It also does nifty things like “shadow-only materials” very handily. The Alpha information is a number, not just “on or off, there or not-there” like blue screen, so it produces softer edge-lines. - I’ve also discovered the “border” button in the renderer. - These techniques, combined with the Sequence Editor, have quite remarkably reduced my render-times.