Need help [Ship masking]

When I render a imgae of a ship useing blender I use a black background but when I put the ship into game it keeps some of the black background around the ship. can anyone help me fix this I have tryed to figure it out. here are two Pictures.

Attached File(s)

This post has been edited by Shinra : 24 August 2009 - 08:12 PM

Looks like a problem with the mask to me. Can you show us what the mask for this image is, so we can check if that is the case?

If it does turn out to be a problem with the mask, you can manually create another one by doing a second render of the ship, colored pure white on a black background.

Take the resulting image and transform it into a black-and-white image; absolutely no gray pixels can be present. I use Photoshop to do this, but I don't know if you have that.

It's defo a masking issue, although I would NOT make masks the way Eugene suggested (no offence).
Masking has a purpose and that is to (partially) show pixels in an image. Pure white masks are horrbile, because you will end up with jagged edges in you images. Although I realize that EVNova uses full white masks, if you import a greyscale mask, it will automatically make a b&w mask out of it (with good results).

Best is to make you output format (render) a format with an alpha channel (I think PNG will work fine). Open the image in Photoshop (or other decent editing software) and take the alpha channel as mask. This will guarantee a good result.

Greyscaling an original image is NOT sufficient. Alpha channels are the way to go 😉

This post has been edited by ReinierK : 25 August 2009 - 04:48 AM

I think Eugene is suggesting making a render of the ship with the texture values set to shadeless white. With AA on, you should get decently smoothed edges with no jag and a perfect fit. It's what I use when I render ships in blender, and it works perfectly for me.

Ah... in that case it should work indeed!
Sorry I misunderstood 😉

Geez I feel primitive... I just use photoshop and use the magic wand to select all the black, then copy and paste onto an all white image....
See? Thats why I dont do graphics.

For a darkly colored ship, that's liable to select parts of the ship as well as the regular black.

I use PaintShop Pro, and what's worked well for me is rendering on a completely black background, taking the magic wand in PaintShop and setting the tolerance to 0, copying the black to a new image, and flattening that new image to a 1-bit mask. Using the magic wand works great if the tolerance is set to 0. Alpha channels aren't a bad way to go, either. Typically, I also use the bucket tool to set what I just copied to the mask as black to the 50% middle-of-the-road gray. It's worked great for me, and is simple to do.

Thank you for the help.

The advantage of using your alpha channel is that EVNEW (if you're on windows) converts every non-black pixel to a white pixel and therefore gives a 100% match as far as masking goes.

You can do the same with levels in Photoshop of course 😉

QUOTE (Eugene Chin @ Aug 25 2009, 01:31 AM) <{POST_SNAPBACK}>

Looks like a problem with the mask to me. Can you show us what the mask for this image is, so we can check if that is the case?

If it does turn out to be a problem with the mask, you can manually create another one by doing a second render of the ship, colored pure white on a black background.

Take the resulting image and transform it into a black-and-white image; absolutely no gray pixels can be present. I use Photoshop to do this, but I don't know if you have that.

This is definitely the way to do it. You probably have a program coming up with whatever it thinks the mask should be, in other words, anything that isn't completely black.

QUOTE (ReinierK @ Aug 31 2009, 11:24 AM) <{POST_SNAPBACK}>

The advantage of using your alpha channel is that EVNEW (if you're on windows) converts every non-black pixel to a white pixel and therefore gives a 100% match as far as masking goes.

You can do the same with levels in Photoshop of course 😉

It's definitely wrong to treat all non-black pixels as part of the mask. I used to just do that, but at times Nova would get it wrong, particularly around the edges of the square. So I'd get random lines corresponding to one edge of the sprite box showing up in-game.

This stopped when I used Photoshop to explicitly reduce to a 1 bit per pixel format (Mode->Bitmap).

Just curious, when you render your ship, are you rendering it at 100% it's in-game size, or 2x? Because it should be 2x, then use an image program to shrink it the rest of the way. It will look crisper, and it will help with the mask. But you may already be doing this, I'm just making an assumption.

Log in to reply