Filters for 3D viewer

Software: Away3D 4.x

Beek, Member
Posted: 21 April 2015 04:13 AM   Total Posts: 67

Hi,

Has anyone attempted to achieve a VR viewer for Google Carboard etc?

I’ve got the split screen working using Stage3dProxy and that part is fine.

For many VR viewers, applications distort and filter the view for different headsets and devices. I’m wondering the best way to go about this in Away3d, or if there are any other examples of this beind done elsewhere.

The kind of effect I’m trying to achieve
http://d8d913s460fub.cloudfront.net/krpanocloud/webvr/index.html?v=119pr1

And there’s some information here
http://krpano.com/forum/wbb/index.php?page=Thread&threadID=12081

Basically I’d like to be able to adjust the effect for various devices.


I tried previously using Filters on the view, but ran into problems where applying the filter filled the screen, and I couldn’t find a way to make the filter work only on one view, without stage3D filling the rest of the screen with a white background because stage3D has to render to the whole screen.
Here’s some ideas for that problem
http://away3d.com/forum/viewthread/5794/

I also looked into how this ANE https://github.com/jonathanhart/oculus-ane works, and again had a similar issue where I couldn’t ge the filter to apply to only one view and not fill the screen.

The stage3d is inialised and opens the new view like this

private function initializeStage3d():void
  {
   Log
.record("Pano.initializeStage3d()");
   
// Define a new Stage3DManager for the Stage3D objects
   
stage3DManager Stage3DManager.getInstance(stage);
   
   
// Create a new Stage3D proxy to contain the separate views
   
stage3DProxy stage3DManager.getFreeStage3DProxy();
   
stage3DProxy.addEventListener(Stage3DEvent.CONTEXT3D_CREATEDonContextCreated);
   
stage3DProxy.antiAlias antiAlias
   
stage3DProxy.width stage.stageWidth;
   
stage3DProxy.height stage.stageHeight;
   
stage3DProxy.viewPort.width stage.stageWidth;
   
stage3DProxy.viewPort.height stage.stageHeight;
   
view.width stage.stageWidth/2;
   
view.shareContext true;
   
view.disableMouse true;

  
}

 
public function loadVR():void
  {
   


   removeEventListener
(Event.ENTER_FRAMEonEnterFrame);
   
stage3DProxy.addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
dispatchEvent(new Event(VR_MODE_ON));
   
initializeVR();
  
  
}
  
  
  
private function initializeVR():void
  {
   Log
.record('Pano.initialize()');
   
initialized true;
  
   
rightEye = new View3D();
   
rightEye.height stage.stageHeight;
   
rightEye.stage.stageWidth/2;
   
rightEye.0;
   
rightEye.backgroundAlpha 0;
   
rightEye.stage3DProxy stage3DProxy;
   
rightEye.shareContext true;
   
rightEye.camera rightEyeCamera;
   
rightEye.camera.lens = new PerspectiveLens(100);
   
rightEye.camera.lens.far cameraViewDistance;
   
rightEye.camera.lens.near 100;
   
   
rightEye.scene scene;
   
rightEye.width stage.stageWidth/2;
   
addChildrightEye );
   
rightEye.render();
   
 

  
   

iceguner, Newbie
Posted: 23 April 2015 12:29 PM   Total Posts: 1   [ # 1 ]

could you be so kind to post your complete source code so that we could learn from it? Thank you!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X