Introducing Starling (Building GPU Accelerated Applications)

By Thibault Imbert

Starling is an ActionScript three 2nd framework constructed on best of the Stage3D APIs (available on laptop in Flash participant eleven and Adobe AIR 3). Starling is principally designed for video game improvement, yet will be used for lots of different use instances. Starling makes it attainable to jot down speedy GPU sped up purposes with no need to the touch the low-level Stage3D APIs.

Most Flash builders are looking to be ready to leverage GPU acceleration (through Stage3D) with no the necessity to write such higher-level frameworks and dig into the low-level Stage3D APIs. Starling is totally designed after the Flash participant APIs and abstracts the complexity of Stage3D (Molehill) and permits effortless and intuitive programming for everyone.

Obviously Starling is for ActionScript three builders, particularly these taken with 2nd online game improvement; after all it is very important have a simple realizing of ActionScript three. via its layout (lightweight, versatile and simple), Starling can be utilized even be used for different use instances like UI programming. That acknowledged, every little thing is designed to be as intuitive as attainable, so any Java™ or .Net™ developer gets the hold of it speedy in addition.

Show description

Quick preview of Introducing Starling (Building GPU Accelerated Applications) PDF

Best Nonfiction books

Pearl Lowe's Vintage Craft: 50 Craft Projects and Home Styling Advice

Classic clothier Pearl Lowe exhibits you the way to create the genuine classic glance on your own residence along with her professional suggestion and straightforward craft tasks. This sensible advisor, whole with inspiring images comprises . .. * 50 step by step craft tasks * stitching, portray, upcycling and crafting secrets and techniques * A how-to consultant to sourcing your personal classic treasures * And Pearl's little black publication of outlets and providers An absolute must-have for fanatics of classic and all issues hand-crafted.

SAP® NetWeaver Portal Technology: The Complete Reference

Your Hands-on advisor to SAP NetWeaver Portal TechnologyMaster SAP NetWeaver Portal with the main finished, step by step reference on hand at the complete portal implementation existence cycle. Written by way of SAP architect Rabi Jay, this booklet presents every little thing you want to plan, layout, set up, configure, and administer SAP NetWeaver Portal, together with SAP NetWeaver program Server Java.

Cloud Computing, A Practical Approach

"The promise of cloud computing is the following. those pages give you the 'eyes extensive open' insights you must remodel your online business. " --Christopher Crowhurst, vp, Strategic know-how, Thomson ReutersA Down-to-Earth consultant to Cloud ComputingCloud Computing: a realistic procedure offers a complete examine the rising paradigm of Internet-based firm purposes and prone.

Database Concepts (7th Edition)

For undergraduate database administration scholars or enterprise execs   Here’s functional aid for knowing, growing, and dealing with small databases—from of the world’s best database specialists. Database techniques by means of David Kroenke and David Auer supplies undergraduate database administration scholars and enterprise pros alike a company realizing of the thoughts at the back of the software program, utilizing entry 2013 to demonstrate the recommendations and methods.

Extra info for Introducing Starling (Building GPU Accelerated Applications)

Show sample text content

ScaleX = picture. scaleY = Math. random(); // convey it! addChild(image); } } } }The suggestion is straightforward, you employ the conventional local snap shots API to attract your traces, strokes, and fills, utilizing the CPU, you then rasterize that on a bitmap and add this as a texture at the GPU. Figure 1-28 illustrates an instance the place circles are getting used with Starling. Figure 1-28. customized dynamic shapes yet wait, don’t you notice an issue the following? Our code is particularly unoptimized, which plays tremendous slowly. are you able to see the framerate we have now the following? round 25fps rather than 60. and consider the variety of draw calls in Figure 1-29! Figure 1-29. FPS, MEM, and DRW numbers one of these excessive variety of draw demands our animation is killing the functionality. we'll see afterward within the part relatedto optimizations that the key for excellent functionality is a truly low variety of draw calls (batching). shall we truly render this entire animation with one and basically draw name and run at silky tender 60fps. So how will we do this? The traces accountable for such undesirable functionality in our code are those traces: // create a BitmapData buffer var bmd:BitmapData = new BitmapData(radius * 2, radius * 2, actual, 0); // draw the form at the bitmap bmd. draw(shape); // create a Texture out of the BitmapData var texture:Texture = Texture. fromBitmapData(bmd);For every one new release, and there are four hundred of them in overall, we create a brand new BitmapData example and a brand new Texture item, that is absolutely lifeless and forces Starling to factor a unique draw demand every one texture. take note our past instance with the sausages? comparable errors the following. We simply have to create one unmarried BitmapData example to render our vectors in and create only one unmarried Texture item that our photo items will use. we'll simulate the several colour through simply utilizing the tint estate at the photo cases: package deal { import flash. show. BitmapData; import starling. reveal. photograph; import starling. show. Sprite; import starling. occasions. occasion; import starling. textures. Texture; public classification online game extends Sprite { inner most const NUM_CIRCLES:uint = four hundred; public functionality Game() { addEventListener(Event. ADDED_TO_STAGE, onAdded); } deepest functionality onAdded (e:Event):void { // create a vector form (Graphics) to exploit as an offscreen canvas var shape:flash. reveal. Sprite = new flash. show. Sprite(); // radius var radius:uint = 20; // decide a colour var color:uint = Math. random() * 0xFFFFFF; // set colour fill form. photographs. beginFill(color); // draw circle with a particular radius form. photos. drawCircle(radius,radius,radius); form. images. endFill(); // create a BitmapData buffer var bmd:BitmapData = new BitmapData(radius * 2, radius * 2, actual, color); // draw the form at the bitmap bmd. draw(shape); // create a Texture out of the BitmapData var texture:Texture = Texture. fromBitmapData(bmd); for (var i:int = zero; i < NUM_CIRCLES; i++) { // create a picture out of the feel var image:Image = new Image(texture); // positioning photograph. x = Math. random()*stage. stageWidth; snapshot.

Download PDF sample

Rated 4.04 of 5 – based on 18 votes