Scaling the viewport output

Another way to reduce the number of pixels rendered by Away3D is to assign a BitmapSession object to the session property in the View3D class. The Number passed to the BitmapSession constructor defines the internal scale of the bitmap that the scene will be rendered into. The default scale is 2, which will create an internal bitmap whose width and height are half that of the view. This means that the final size of the internal bitmap is one quarter of the size of the view, and thus only a quarter of the number of pixels need to be rendered.

To use the BitmapSession class, it first needs to be imported from the away3d.core.session package. A new BitmapSession object can then be assigned to the session property in the View3D class:

view.session = new BitmapSession(2);

The internal bitmap is scaled up to fill the stage when it is drawn. So unlike clipping the viewport, using the BitmapSession class allows your application to be displayed using the entire area available to it. However, this does result in a pixilated look. You can see this pixelation in the following images. The BitmapSession object used to render the image on the left has a scaling of 1, while the BitmapSession object used to render the image on the right has a scaling of 2.

Scaling the viewport output
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.210.219