Hi,
when rendering ,the backgound is black by default. and you can set
view.backgroundColor to change the color of background. But can I make it transparant so I can paste it to the 2D scene.
Is is possible to Set View Background transparentSoftware: Away3D 4.x |
||
cosophy, Newbie
Posted: 26 July 2011 12:44 PM Total Posts: 5 Hi, when rendering ,the backgound is black by default. and you can set |
||
theMightyAtom, Sr. Member
Posted: 26 July 2011 01:43 PM Total Posts: 669 [ # 1 ] The short answer is no. The bit longer answer is, maybe in the future (there is a Stage3D.transparent flag, that dosen’t appear to do anything in the current player) The “I can’t wait” answer is you could take a snap shot from your 3D scene, key out the background, and have it as a Bitmap in Flash. Alternatively, and the way I do it at the moment, is to make a “background” (Plane primitive) in the 3D scene where you can show images and video, with your objects on top. It’s been suggested a couple of times that a backgroundImage feature could be added to Away3D 4.0. Hope so |
||
cosophy, Newbie
Posted: 26 July 2011 02:34 PM Total Posts: 5 [ # 2 ] For optimization, I was thinking about convert the view to a Bitmap at advance, then use 2D bitmap to display the 3D object. |
||
David Lenaerts, Administrator
Posted: 26 July 2011 03:03 PM Total Posts: 80 [ # 3 ] I figured the Stage3D::transparent property didn’t work since the View3D’s backbuffer was always cleared with alpha 1. So I added a backgroundAlpha property (that automatically sets the correct transparent value on Stage3D). However, it still doesn’t seem to affect things (maybe it will still show StageVideo behind it). Ah well, at least we’re future proof with that |
||
theMightyAtom, Sr. Member
Posted: 27 July 2011 10:24 AM Total Posts: 669 [ # 4 ] Here’s a (dis)proof of concept for placing Molehill content above Flash content. http://videometry.net/broomstick/transparentMolehill/ source: The framebuffer is swiped from Away3D every frame using The background (bright green) is then removed. As the example demonstrates, doing this every frame is just too heavy, but the technique can be used for other things, for example to build reflection maps automatically from a scene. For now I’d recommend placing your 2D content on a Plane in your 3D scene if possible. Fully hardware accelerated Augment Reality (Molehill over HD video) will just have to wait… Props to Quasimodo for the Chroma Key filter: Cheers! |