Making masked sprites


(Hannes) #1

I am trying to use blender to make 2D sprites for a game I’m programming (I’m kind of a newbie when it comes to blender).
I found a tutorial showing how to make some great explosion images, however I have one problem.
For my game I want the background of the .bmp sprites to be bright pink (RGB: 255, 0, 255). Everything with this color will then be transparent in the game. But when I render my explosion animation, blender uses some kind of anti-aliasing (I think) which makes the edges of the explosion somewhere between black and yellow. Simply coloring the outside pink will produce very poor results: the explosion will only look good when drawn on a black background (if I render it with a black background in blender that is), because the outer edges are blackish.
What I would like is some way to render images with a background that has only one color (in this case bright pink) without the edges being close to this color. Is this possible somehow?


(Gomba_3333) #2

Go into the world buttons, and add a new world. Then change the Background and zenith colors to the pink that you require :).


(Hannes) #3

I’ve already tried that, but it will only result in an image that is somewhere between yellow and pink in the edges (only the pixels that have the RGB value 255, 0, 255 will be masked).


(Keithkosh) #4

Turn off Blender’s anti-aliasing. The only problem with that, is that your sprites will look uglier because they themselves wont be aliased either, but at least the edges will be clean.

Or, just edit the sprites in Paint or PSP or something, and remove some of the anti-aliasing on the edges by hand, that way you’ll retain the anti-aliasing inside the actual sprite…

either way would work i guess, but i dont think theres any other way.


(Hannes) #5

How do I turn off blender anti-aliasing?


(ed26) #6

go to the display buttons window (F10) i think. find the button that says ‘OSA’ make sure its not pressed. that will turn off AA.


(endi) #7

In 3DMax, there is a function, called 'disable anti-alias with background". So we need this function in Blender.


(mthoenes) #8

I have been learning a good bit from forum members lately about transparency. Can you make use of an RGBA targa file. If you set the Alpha type to “Key” it causes the color the world color take on the the values of the lower horizon blend sliders and makes that the transparent color. I probably an explaining this poorly… But it works great for me.