To Anti-Alias or not to Anti-Alias - That is the question!


(Albinal) #1

I’ve started working with on a game project that requires my final renders to have aliased edges. So, I can easily turn the OSA button off and achieve this. Unfortunately this means that the rest of the model is also aliased… making it look rubbish!

My question is; Can you render a final image with an anti-aliased body and aliased edges?

Many thanks!


(RipSting) #2

Yes, in fact there is a way. Under the Render Buttons Window (F10) there is a set of toggle buttons under the Render tab called “Sky”, “Premul” and “Key”. If you change this to Key it will leave any edges aliased where they come in contact with the sky.


(Albinal) #3

Wow! Thank you very, very, very, much! This application and this forum never cease to amaze me! :smiley: :smiley: :smiley:


(Albinal) #4

I can’t seem to get this to work in 2.37a. When I export the image with an alpha background (with Key on) the edges become Anti-Aliased… Does anyone have any ideas?


(Modron) #5

if you want hard edges just turn off osa.


(Albinal) #6

Yes… but then the rest of the model looks naff… I want an anti-aliased image with hard edges. Dare I say “read the 1st post”??? :smiley:


(z3r0 d) #7

instead of using the alpha channel from the image, use the world color as a transparent color

[and set it to something nothing in your scene would use, like hot pink or neon green]


(Albinal) #8

I’d love to but as soon as I press Key the world background turns to black!?!? I’m actually trying to get a final image that has an anti-aliased body, hard edges and a magenta background.


(Albinal) #9

This is what I am trying to achieve:
http://www.z7.pwp.blueyonder.co.uk/MARS/Bunker/bunker_view_1.png

I had to re-install v2.36 in the end but am obviously wondering why it doesn’t work in v2.37a. Also, when you have an ortho camera no matter where you move it the size of the image is always the same… the only way to change it is to change the scale. Weird.


(Trident) #10

But that is the way ortho should work. No perespective, -> no vanishing point ->, no changes in apparent size with camera movement.


(Albinal) #11

I’m sure it didn’t used to work like that. I once did an animation (in ortho view) of a map with buildings on it and swung the camera from high-up down to building level. Are you saying that this type of animation is not possible now?


(Trident) #12

Do not know about earlier Blender versions, but moving camera definitly should have NO effect on size of objects in anything called “ortho view”. Maybe you actually used zoom somehow? +/- and mouse wheel do not “move” viewport too, BTW, they zoom in/out.


(osxrules) #13

That’s right. You would composite the image rendered using key with a magenta background in either the sequencer, a compositor or 2D image program.

If you are always going to have the magenta background, why turn off the anti-aliasing? You usually only need rough edges if you are doing compositing.


(Albinal) #14

If you are always going to have the magenta background, why turn off the anti-aliasing? You usually only need rough edges if you are doing compositing.
Because I don’t always want to have a magenta background! I’m pretty sure that it works along the same lines as blue/green screen filming. Since magenta is unlikely to feature on any of the models it’s a good choice to use for chroma-keying.

If you anti-alias edges against a magenta background then when you remove the background to replace it with whatever you want you end up with a magenta(ish) outline.

I know what I’m trying to do, there is an example of it above… this example was produced using Blender 2.36 yet I cannot get the same results in 2.37a! The question is why???

Do not know about earlier Blender versions, but moving camera definitly should have NO effect on size of objects in anything called “ortho view”. Maybe you actually used zoom somehow? +/- and mouse wheel do not “move” viewport too, BTW, they zoom in/out.
Thanks for the response. What you’ve said makes sense to me but I’ve just installed v2.36 and if I move the camera closer to an object it gets bigger… I re-installed v2.37a and moving a camera closer to an object makes no difference. In my opinion I’d rather have v2.36 but perhaps, because it’s wrong, they fixed it???


(phlip) #15

Surgeon General’s Warning: Long technical ranty post ahead. Reading this post without due care may be hazardous to your mental health.

In 2.35a and earlier, there were 3 buttons, “Sky”, “Premul” and “Key”. Sky would render the background using the sky set up in the world buttons. Premul would make a picture with a pre-multiplied alpha channel. Key would make an image that was perfect for chromakeying - antialiased interiors and jagged edges - exactly what you’re asking for here. All 3 button’s names made sense, and all 3 were useful, except for one minor detail - none of them made a simple alpha image that was good for compositing in other apps - premul only worked if the program expected it, which many didn’t. Key was bad if you didn’t need the 1-bit alpha style, and sky still had the aliasing effect along the edges with the sky colour.

So in 2.36 they added the “normal” alpha render. However, they had the “inspired” idea of replacing “Key” with this new feature. Of course, this means that “Key” is now a misnomer, since the results cannot be used for chromakeying. It also means that there is no real way to make good chroma-keyable sprites any more. It also means that all the help people give saying “use key!” no longer applies. Why they didn’t add it as a fourth button is beyond me.
They didn’t even mention it in the Release Notes - I only narrowed it down to this release by trying it in each one. It works in 2.35a and doesn’t in 2.36. Though, based on people’s reactions in this thread, in which I made a plugin which generated these “true-alpha” images (before I knew Key had been changed), it seems to have been deliberate.

this thread has some good ideas for doing this without using Key.


(Albinal) #16

Gulp! I fear I’m getting out of my depth here! Thanks for the reply phlip - You definately seem to know what you’re on about and what I want… It seems like a crazy decision to me to remove this feature… it used to work fine and if it ain’t broke… don’t fix it! :frowning:


(osxrules) #17

I misunderstood when you said:

I’m actually trying to get a final image that has an anti-aliased body, hard edges and a magenta background.

If you anti-alias edges against a magenta background then when you remove the background to replace it with whatever you want you end up with a magenta(ish) outline.

I know but that’s what key is supposed to do. I just did a test myself and rendered an image with key and composited it onto another image in Photoshop.

if I move the camera closer to an object it gets bigger… I re-installed v2.37a and moving a camera closer to an object makes no difference. In my opinion I’d rather have v2.36 but perhaps, because it’s wrong, they fixed it???

I’m guessing it could be that older Blender versions didn’t have proper ortho views, it was just a camera with a really high lens value. I doubt that’s what you are seeing but it’s the only thing I can think of.


(phlip) #18

Ooh, I just found a useful button in GIMP that could be handy:

  • Render the image with the new “Key”
  • Turn on “RGBA” and save as either PNG or TGA (the ones that support an alpha channel)
  • Load it up into The GIMP
  • Layer->Alpha->Threshold
    Gets the jaggies on the edges, but still antialiased in the middle :smiley:

(Albinal) #19

One problem… I no use gimp!

If I want an alpha background I usually export as a PNG that I then open in Macromedia Fireworks. But I’m still finding it impossible to get the hard edges and anti-aliased body without re-installing Blender 2.36… where it is oh so simple.


(Trident) #20

Exsactly. It was described in detail in 2.37 release notes. (In pre-2.37 UI lens value was multiplied by 1000 IIRC, plus camera was translated back from it visible position for “ortho”. 2.37 and up does use proper ortho instead of this trick.)