I have a flash application where two 3d Views are sharing the same Stage3DProxy, because I need one to be overlaid/drawn over the other at all times. However, they seem to share the same 3d space/z-buffer(?).
My update function currently looks like this:
private function onEnterFrame(event : Event) : void {
stage3DProxy.clear();
away3DView.render();
away3DView2.render();
stage3DProxy.present();
}
Clearly, this is not enough on its own - I read somewhere that the setDepthTest method can be used eg:
stage3DProxy.context3D.setDepthTest(false, Context3DCompareMode.NEVER);
...setting it to different modes between each view’s render() call, but I’m not at all clear on how this works, and documentation does not seem to address a situation like this. I’ve played around, setting it to different things between render calls, but no joy.
The only examples I can find for setting up a Stage3DProxy use one Away3D view and two starling - which isn’t what I’m after. I read on the forums a comment which says you have to specify certain setDepthTest settings in about ‘8 other places’, but doesn’t elaborate on where they are or what they need to be set to, and this sounds like quite a hack for something which should be pretty basic!
If anyone could help I’d be very grateful, or if anyone knows another way to do this - forcing a particular drawing order seems like it should be a relatively trivial task yet I can find nothing useful about doing it, I want to stick with Away3D as it’s got a nice API and feature set, but this is a real obstacle to my current project!
Thanks in advance