Share to EffectHub.com

You can earn money or coins from your share:)

Tips: you can use Sparticle for uploading away3D effects.

Tips: you can download Sparticle for uploading effects.

Tips: The ActionScript editor is supporting Away3D, Starling, Dragonbones and Flex frameworks.

Tips: paste the web page URL then click button:)

EffectHub.com: Your Best Source for Gaming
Login    or

Away3D and Starling interoperation

Since the introduction of Stage3D in Adobe AIR 3 and Flash Player 11, numerous ActionScript 3 frameworks have been introduced and others upgraded to take full advantage of the newfound GPU acceleration. Away3D is one of those frameworks now leveraging these GPU features allowing developers to create incredibly rich 3D interactive experiences. Starling, similarly, is another framework exploiting the power of Stage3D but is focused on providing GPU accelerated 2D graphics.

There have been requests from both the Starling and Away3D developer communities to be able to combine both 2D and 3D frameworks together in a single application. However, this required modification to the APIs themselves or to have each framework render in its own separate Stage3D instance. Unfortunately, along with a greater performance overhead, transparent Stage3D instances are currently unsupported so overlaying the instances obscures the instance beneath, destroying the desired effect.

 

Figure 1. StageVideo, Stage3D and standard Stage instances
Figure 1. StageVideo, Stage3D and standard Stage instances

With the release of Away3D 4.0 Gold and the latest Starling sources from Github, comes the ability to easily combine multiple frameworks into a single Stage3D instance. You can now layer any combination and any number of Away3D or Starling instances.

This tutorial will take you through an example of having a background Starling layer, a middle Away3D layer and a foreground Starling layer.

 

Figure 2. Example of two Starling layers and one Away3D layer inter-mixed
Figure 2. Example of two Starling layers and one Away3D layer inter-mixed

Initializing the shared Stage3D instance

Under normal operation, when either Away3D or Starling is being used individually, management of the Stage3D is handled internally within the respective framework. This internal management makes them extremely easy to use, but also causes difficulties in sharing the Stage3D instance. Instead, each framework needs access to a common Stage3D instance where all rendering will happen. This is done through the Stage3DManager and Stage3DProxy classes within the Away3D framework.

// Stage manager and proxy inst...

You must Sign up as a member of Effecthub to view the content.

1354 views    1 comments

You must Sign up as a member of Effecthub to join the conversation.

Join Effecthub.com


Or Login with Your Email Address:

Or Sign Up with Your Email Address:
This field must contain a valid email
Password should be at least 1 character