4

I’ve been trying to add the property filter3d to a view3d, while preserving an image background. I’ve instantiated a stage3DManager, as well as setting a stage3DProxy:

stage3DManager = Stage3DManager.getInstance(_stage);
stage3DProxy   = stage3DManager.getFreeStage3DProxy();

stage3DProxy.addEventListener(Stage3DEvent.CONTEXT3D_CREATED, onContextCreated);

The view3d only gets instantiated when the context3d is created:

away3dView = new View3D();
away3dView.stage3DProxy = stage3DProxy;
away3dView.shareContext = true;
// away3dView.filters3d = [new MotionBlurFilter3D()];     <——  (╯°□°)╯︵ ┻━┻)

When trying to add this line of code, it just makes the ‘background’ shrink or disappear, depending on the way the background has been created. I’ve tried two different ways of adding the background:

Assigning a BitmapTexture to the background property on View3d results in a displacement of the background

view.background = new BitmapTexture(footballBackgroundBmd);

Using starling, as shown on this tutorial, results in the removal of the background

starlingCheckerboard = new Starling(BackgroundImage, _stage, stage3DProxy.viewPort, stage3DProxy.stage3D);

Both of these methods display a background image and works nicely. However, when adding the filters3d property on the View3d it breaks. I understand that adding a filters3d will affect the entire view, but I do not understand what is happening with the background.

I am not entirely sure if I’m doing something completely wrong here :/

1
  • Did you have a look at this tutorial : away3d.com/tutorials/Away3D_and_Starling_Interoperation From my experience, mixing two stage3d frameworks better work with manually handling the enterframe loop and specially the stage3d clear and present calls, like in the tutorial part called "Taking control - the manual approach"
    – Ricovitch
    Aug 4, 2018 at 16:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.