|
mikerz, Newbie
Posted: 06 August 2012 06:52 PM Total Posts: 6
Hi all,
So, I’m trying to implement an anaglyph feature based off of something I had working in Away3d 3, and I can’t seem to make two view3ds visible at once. Does the render call cancel out what is on the screen, or in the container sprite?
I have two instances of view3d, two camera3d and one of a scene3d… the scene is shared because the geometry is identical. The scene contains a 3d model with a skybox. I apply a blendMode to the ‘right’ view and both of them get colortransforms applied—one with just red and full alpha and the other with full alpha and gb. I only ever see one view, and it looks full color to me.
Any ideas of what I should do to make both render at once? More info needed for this issue? Maybe I need to create a different implementation that doesn’t use ColorTransform, perhaps store each frame in a bitmap and render that (worried framerate will be terrible though)?
Update: I’m rendering into bitmaps now and displaying through those; performance is considerably worse but possibly good enough…
thanks
|
Richard Olsson, Administrator
Posted: 07 August 2012 08:01 AM Total Posts: 1192
[ # 1 ]
In Away3D 4.0, the View3D display object is just a “proxy” to allow the programmer to position the 3D view using a familiar interface (the display list.) Nothing is actually rendered inside the View3D display object, so applying color transforms, alpha et c has no effect.
Instead everything is rendered at the very back, per the rules of Stage3D, which means that if you have two views that overlap the second one to render will clear any overlapping areas.
There is a stereo rendering package in the works, that I could possibly commit to a feature branch if you want to try it out. It never leaves the GPU, so is considerably fast. It was developed during a client project, and supports anaglyph and interleaved rendering.
|
|
mikerz, Newbie
Posted: 07 August 2012 02:06 PM Total Posts: 6
[ # 3 ]
Sweet! Thank you, I will take a look. It makes sense that the view3d is a proxy; I didn’t understand how Stage3D is implemented and thought perhaps the regular display properties of the sprite would be implemented post-rendering.
I am familiar with GL programming but not the structure of away3d 4 (just got it last week haven’t delved into core) and figured it would take me a while to figure out how to implement a shader based anaglyph with rendering 2 cameras…
|
mikerz, Newbie
Posted: 08 August 2012 02:34 PM Total Posts: 6
[ # 4 ]
Hello!
Just checking in; I modified the class a bit to work with my version of away3d and then to the release branch… works great! I’m just going to add different color sets and I’m all done (red/cyan, red/green, red/blue, trioscopic).
Performance is much better now that it’s handled by GPU.
Great work!
|
|
theMightyAtom, Sr. Member
Posted: 09 September 2014 07:44 AM Total Posts: 669
[ # 6 ]
On mobile you only have one Stage3D instance to work with.
However, you can still have multiple windows
You have to use the Stage3Dproxy inbuilt in Away3D.
I’m sure if you google it, you will find examples. Then
you can have multiple windows, or starling layers, etc.
Good Luck!
|
xiaonvren, Newbie
Posted: 15 December 2014 12:14 PM Total Posts: 3
[ # 7 ]
I need to create a different implementation that doesn’t use ColorTransform, perhaps store each frame in a bitmap and render that (worried framerate will be terrible though)?
_______________________
my site:fifa coins
|