PDA

View Full Version : Another rendering question


svero
12-12-2005, 11:42 PM
This is probably a better question for a Softimage Xsi forum, but I've given the cg forums a shot and so far not much luck. It seems to be a bit of a game specific problem I guess... not something your normal rendering dudes deal with much.

Say I have a glass sphere that is tinted slightly green and has some specularity and highlights. If I render that out to an image I get a nice glass sphere which I can see inside of an through etc. The default background is black.

Now if i render the glass sphere to a file.. say png or tga with alpha, what I get is a glass sphere which is see through but where the background behind the sphere itself is not just transparent, but rather a composite of the black background from the scene and the green glass color. So if i pasted it over a black background it would be the perfect see through alphad sprite, but if i paste it on a white background suddently it looks all wrong since you're looking through it to black.

Hopefully thats a clear enough description of the problem.

So far the only solution I've found is one for clear glass where I render only the specularity and highlights.. but for colored glass I can't see any way to get rid of that black. Anyone know a solution to this?

Andy
12-13-2005, 12:25 AM
Render either on green background instead of black.
OR
Render the solid (not transparent) sphere and use the alpha channel from another (transparent) rendering.

Both variants wouldn't give you too great results - the refraction of real glass shpere is much more complicated. But this is not what you were asking. :)

svero
12-13-2005, 12:57 AM
Neither of those is great. Rendering on green background isnt even an option and rendering a separate alpha pass wont show the stuff inside the sphere.. Rendering the sphere out separately is terrible too since there are hundreds of frames of animation and I cant composite them by hand easily.

- S

Andy
12-13-2005, 01:11 AM
So ask the correct question if so? ;)

You asked how to exclude the black I said you. :)
Faked glass sphere isn't too hard task as well. But as I said this is another story. Such recommendation would require the additional data at first what would you like to see in that sphere what a technology you use - 3D/2D through 3D/ or something else. And it's anyway would be already the question to coders - not to me. :p

Fost
12-13-2005, 01:50 AM
I'm not sure if this is the answer, but have a look if there are any options to save the image out without pre-multiplied alpha.

I know I've done this before in 3dsmax, but that was years ago and my memory is a little hazy - but I'm sure not having pre-multiplied alpha was what you needed to do.

svero
12-13-2005, 02:22 AM
That did it fost. I found the alpha premultiply optiona and turned it off and got what I wanted. Great. Thanks.