Can you render a scene to a file w/ transparent background?

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Can you render a scene to a file w/ transparent background? // New Users

1  |  

Post by paulmeherjr // Aug 12, 2008, 9:55am

paulmeherjr
Total Posts: 14
I'm using Truespace 3.2. Is there a way to render a scene to a file, which has one object, with a transparent background?? Did that make sense? :confused: I'm very new at this, but want to learn as much as I can. Thanks!!

Post by jamesmc // Aug 12, 2008, 10:17am

jamesmc
Total Posts: 2566
I don't remember anything about 3.2 to help you.

If your system can handle 7.6, why not download it?

It has layers and can be saved as a PSD file which can be opened by PhotoShop, Corel Paint Shop Pro and the free GimpShop.

Then, you can just turn the background layer off and perhaps substitute one of your own.

Post by paulmeherjr // Aug 12, 2008, 10:36am

paulmeherjr
Total Posts: 14
I actually did download 7.6, but it was alot different than 3.2, as you can imagine. I learned a little on 3.2 and I just got to the point where I know pretty much where everything is.


I will keep trying with 7.6, as well, and I will take your advice with 7.6. Thank you for the response. I appreciate the help.

Post by spacekdet // Aug 12, 2008, 11:02am

spacekdet
Total Posts: 1360
pic
You'll need to render to a 32 bit format (TGA, PNG, GIF, etc) to do what you want. I don't recall what formats tS 3.2 output off the top of my head.
Take a look at the options available in the 'Save As Type' dropdown list when you render to file. I know in later versions that if you saved to one of these formats the background would automagically be on a separate layer.
Alternately you can render on a solid color background (use a color not present on the object) and use a 2D editor (gimp, PS, PSP, etc) to separate the object from the background.

Post by TomG // Aug 12, 2008, 11:26am

TomG
Total Posts: 3397
For the solid color background, be sure to leave Anti-Aliasing switched off (otherwise your background color will "bleed" into the edges of the object, making it impossible to cut out cleanly from the background). This is effectively like green screening is in the movies :)


The anti-aliasing may also have wanted / unwanted effects in using PNG and TGA with 32 bits, you'll have to test and see which works best.


With tS7.6, you have the option of rendering to PSD, you could put objects on their own layers to achieve that effect (probably other combinations of PSD layers will give the effect too).


HTH!

Tom

Post by paulmeherjr // Aug 12, 2008, 2:37pm

paulmeherjr
Total Posts: 14
Okay, I will try all the suggestions. That was the problem I was having with separating the object from the background...the edges of the object looked awful and that is actually why I've been trying to figure out way to have a transparent background.


Also, I think I really need to try to figure out 7.6. It actually sounds much easier (that's my excuse for still using 3.2 :p) Thanks again for the help!!

Post by TomG // Aug 13, 2008, 3:47am

TomG
Total Posts: 3397
"Awful edges" sounds like anti-aliasing may have been on, blending the background color into the object. So if you render on a white background, cut out the object and place it on a dark background, the object edge will have a "white glow" look to it (as it will have some of the white background in it).


Best is to render without anti-alias, then add it later. Rendering using transparency will still blend the colors if you have AA on, but I think it might also create an anti-aliased alpha channel too to offset that some.


Why are you cutting the object out from the background btw?


HTH!

Tom

Post by paulmeherjr // Aug 13, 2008, 1:44pm

paulmeherjr
Total Posts: 14
I recently graduated from a college with a degree in web design, with little professional experience, at this point. I learned a little in Truespace in a Multimedia class in college (different college than the one I have the degree in), but we didn't get too much into it. Not as much as I would have liked. I've done a few things but nothing too complicated. I'm still taking a few more college courses (another MM class and a Photoshop class...which I should have already had at the first college, since I was going there for Web Design). So I'm pretty new at Truespace. I would like to be able incorporate a little Truespace in designing web sites.


The reason I'm trying to cut the object out of the background? Well, what I'm trying to do is make a logo (with letters), and I have rendered it with AA on. And the edges don't look good at all. When I render it w/out AA, the logo itself really don't look.


You mentioned to render w/out AA, then add it later. How do I add AA after I render it?


Thank you for the help!!

Post by splinters // Aug 13, 2008, 2:22pm

splinters
Total Posts: 4148
pic
I do this a lot for logos (at least that is what I think you are doing).

Render out against a neutral background (white is possible) at a much higher rez than you need. Then in Photoshop or similar, use a magic wand tool to select the white background then delete it. Use layers>matting>defringe 1 to remove any unwanted edge then save out as a 32BMP with alpha or PNG-24.
The you have a logo with a transparent background and rendering at much higher res is effectively what AA does anyway...:D

Post by paulmeherjr // Aug 13, 2008, 2:33pm

paulmeherjr
Total Posts: 14
I've actually tried the Magic Eraser Tool in PS. I will try the Magic Wand Tool right now. I'll let you know in a few. Thanks for the help!

Post by splinters // Aug 13, 2008, 2:57pm

splinters
Total Posts: 4148
pic
Remember, the bigger file you render; he crisper your edges will be.


After all, when you use 4X AA it actally renders your image 4 times bigger before shrinking back down...just as easy (and often better) to render 4 x larger in the first place...:D

Post by paulmeherjr // Aug 13, 2008, 3:18pm

paulmeherjr
Total Posts: 14
I tried it and it was much better doing it using the magic wand. I used 4X AA, as well. Now I just have to work on my designing a little more. Like I mentioned before, I went to school for web design, graduated, and never took a PS class. Doesn't make sense. I've learned more about WD in my Multimedia class in another school. I feel like I'm going backwards or starting over.:o I am eager to learn though. Thanks again for the help!

Post by paulmeherjr // Aug 13, 2008, 3:29pm

paulmeherjr
Total Posts: 14
Splinters,


When you said, "save out as a 32BMP with alpha or PNG-24" , exactly how do I do that. When I 'Save as' Alpha Channels is not highlighted for me to choose. Is that part of what you mean? Thanks!

Post by splinters // Aug 13, 2008, 3:46pm

splinters
Total Posts: 4148
pic
Watch the tolerance settings on the Wand and experiment until you grab all of the background colour without selecting any of the actual image. Try a tolerance of 15-20 to start with.


As for the PNG-24, try save for web instead of save as and choose PNG-24 from the drop down menu. That will give you a .png file with transparency (make sure to select transparency in the checkbox) which can be used on the web or dragged into PSD documents...:D

Post by splinters // Aug 13, 2008, 3:54pm

splinters
Total Posts: 4148
pic
This is, of course, a quick fix...there are other options such as rendering out in PSD format, each seperate object...:D

Post by TomG // Aug 13, 2008, 3:55pm

TomG
Total Posts: 3397
What anti-alias does is render the image larger than you see it, and then scale it down. If you render yourself to a large image, you can turn off AA, then when you resize in photoshop afterward, you are in effect "adding anti-alias".


Can't recall if sprite rendering survived into tS7.6 - it anti-aliased the inside of an object, but not the edges, giving you the benefit of AA on the inside, but still sharp unblended edges for the outside so you could cut your sprite out and not have a background color "halo" to the edge.


For your needs though, probably better to do it the "manual AA" way. Eg for a 100x100 image, to get 2 times anti-alias render to 200x200 and then resize to 100x100. For 4 times AA, render to 400x400 and then resize to 100x100.


I generally find this gives better results and is a little faster overall than rendering with AA (leaves tS to just do the rendering and no resizing calculations).


HTH!

Tom

Post by paulmeherjr // Aug 13, 2008, 4:06pm

paulmeherjr
Total Posts: 14
Okay, I will try and see if I can figure it out. Thanks for the help!

Post by paulmeherjr // Aug 13, 2008, 5:13pm

paulmeherjr
Total Posts: 14
Tom,


I think I understand what you mean for the most part. The one part I was unsure of was:


"For your needs though, probably better to do it the "manual AA" way. Eg for a 100x100 image, to get 2 times anti-alias render to 200x200 and then resize to 100x100. For 4 times AA, render to 400x400 and then resize to 100x100."


You're doing this in PS? If so, I'm not sure how you'd do this in TS. And if you do mean PS, then how do you 'render to 200x200 and then resize to 100x100', 'render to 400x400 and then resize to 100x100', etc.?


I hope I'm not bother anyone with so many questions, which are probably basic. Thank you for your patience and the help!

Post by Steinie // Aug 14, 2008, 1:38am

Steinie
Total Posts: 3667
pic
You can either have trueSpace apply anti-alias during rendering by settings (2x,3x,4x, AA) or turn off anti-alias and render to a larger size. Downsize to correct size using Photoshop (or other graphics program) which is the "manual way" of removing jaggies as in Tom's example.
p.s Your not a bother, we love this stuff.

Tom,

I think I understand what you mean for the most part. The one part I was unsure of was:

"For your needs though, probably better to do it the "manual AA" way. Eg for a 100x100 image, to get 2 times anti-alias render to 200x200 and then resize to 100x100. For 4 times AA, render to 400x400 and then resize to 100x100."

You're doing this in PS? If so, I'm not sure how you'd do this in TS. And if you do mean PS, then how do you 'render to 200x200 and then resize to 100x100', 'render to 400x400 and then resize to 100x100', etc.?

I hope I'm not bother anyone with so many questions, which are probably basic. Thank you for your patience and the help!

Post by paulmeherjr // Aug 14, 2008, 1:58am

paulmeherjr
Total Posts: 14
Steinie (and everyone that has posted),


Ahh, I get it. I finally checked out the rendering options and seen that you can render at different larger sizes. I tried it and now I understand. Thanks so much for the help and again...the patience.

Post by TomG // Aug 14, 2008, 3:45am

TomG
Total Posts: 3397
Yep, what Steinie said! Turn off the AA, then render to a size that is larger than you need. If your image is going to be 100x100 on your website, for 4 times Anti Alias, render to 400x400 from trueSpace. You now have a 2D image 4 times longer and 4 times taller than required.


In Photoshop or other 2D art package, open that image, do your magic wand, and cut out the object from the background. This lets you get a "sharp" edge as at this point there is no anti-aliasing involved to blend the edge to the background color. Ensure the background is colorless (just a blank, empty layer in Photoshop for instance).


Now with no background color in the image, resize the image to 100x100 in the 2D package. Now you have an anti-aliased image, and the edge of the alpha will be smoothed and anti-aliased too, but without any blending to a background color in the main image. Soft edges to any background color you place the image on!


Now save to a 32 bit format that supports transparency. PNG will give the best results (lossless) but larger file sizes. GIF should work too.


HTH!

Tom

Post by paulmeherjr // Aug 14, 2008, 11:34am

paulmeherjr
Total Posts: 14
Thanks Again!!
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2021. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn