SlideShare a Scribd company logo
Fast rendering with
Starling
BAFPUG 2015
Sergey Gonchar
http://gonchar.me
Stage3D API
• Since 2011 (Flash Player 11)
• Unified API for managing texture memory, vertex
shading, pixel shading, and mesh rendering
• Transparently executed using OpenGL and DirectX
Each frame
— clear backbuffer by calling Context3D.clear
— set gpu state through Context3D API
— call drawTriangles()
— repeat until the scene is entirely rendered
— call the present() method to display the rendered scene on the
stage. It copies the backbuffer to a framebuffer
Context3D profiles
• BASELINE_CONSTRAINED for web - windows
• BASELINE for web - mac
• MAX PROFILE for mobile
Sergey Gonchar - Fast rendering with Starling
Profiling Tools
• Adobe Scout
https://creative.adobe.com/ru/products/scout
• Intel GPA https://software.intel.com/en-us/gpa
• Xcode OpenGL Tools
https://developer.apple.com/opengl/
• RenderDoc http://cryengine.com/renderdoc
http://gamua.com/starling/
How does QuadBatch work?
• Collects quads with the same state(same texture,
blendMode, shader)
• Transforms all vertices to one space and upload
to VertexBuffer
• Render
Sergey Gonchar - Fast rendering with Starling
Starling VertexBufferDescr
• va0 - x,y
• va1 - r,g,b,a
• va2 - u,v
Constants approach
• Create one common vertexBuffer during application
init, upload data once
• Batch quads and images by the same state and set
program constants
array(x,y,width,height,uv,tintcolor,rotation)
• Render
New VertexBufferDescr
• va0 - x,y,index
How does it work?
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
PixelPerfect Touch CPU
Approach
• hitTest Quads
• hitTest texture
• repeat until find
PixelPerfect Touch GPU!
• Use simple shader which renders images with
single color
• Optimization: collect candidates by bounds
• Render targets to 1x1 texture on desktop or 4x4
texture on mobile
• Read back & sample color from texture
Scene
Touch test
Books
http://www.amazon.com/Practical-
Rendering-Computation-Direct3D-
11/dp/1568817207
http://www.amazon.com/Adobe-
Stage3D-Molehill-Programming-
Beginners/dp/1849691681
Thank you!
• Blog http://gonchar.me/
• Follow me http://twitter.com/UnknownFlasher
• Stage3D http://facebook.com/groups/stage3d
• FlashDaily http://flashdaily.net

More Related Content

PPT
Sergey Shamruk - Building Project From Scratch
PPT
Fast rendering with starling
PDF
The tech. behind RoboBlastPlanet
PDF
Whats new in Feathers 3.0?
PDF
The Road to Starling 2
PDF
Adobe AIR for mobile games
PPTX
Unleash 3D rendering with WebGL and Microsoft Edge
PPTX
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Sergey Shamruk - Building Project From Scratch
Fast rendering with starling
The tech. behind RoboBlastPlanet
Whats new in Feathers 3.0?
The Road to Starling 2
Adobe AIR for mobile games
Unleash 3D rendering with WebGL and Microsoft Edge
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es

What's hot (20)

PPTX
NGF2014 - Create a 3d game with webgl and babylon.js
PPTX
HTML5DevConf - Unleash the power of 3D with babylon.js
PPTX
Unleashing WebGL & WebAudio with babylon.js
PDF
Web xr:vr getting started
PDF
Minko - Windows App Meetup Nov. 2013
PDF
Metaverse building (blockchain, nft, 3d, vr)
PDF
G3m overview
PPTX
Glob3 Mobile. Point Cloud Streaming
PPTX
Vectorial Streaming. Como FOSS4G Europe 2015
ODP
Scenejs
PPTX
Unleash 3D games with Babylon.js - JSConf 2014 talk
PPTX
Azure Functions
PDF
HTML5: New UI Library for Games - Chad Austin
PDF
Writing native Linux desktop apps with JavaScript
PDF
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
PDF
Thinking cpu & memory - DroidCon Paris 18 june 2013
PPTX
Amazon EKS: the good, the bad, and the ugly
PPTX
Creating a third-person zombie horde shooter using DOTS – Unite Copenhagen
PPTX
Going Mobile with AIR+Starling
PPTX
From HTML to pixels on the Screen
NGF2014 - Create a 3d game with webgl and babylon.js
HTML5DevConf - Unleash the power of 3D with babylon.js
Unleashing WebGL & WebAudio with babylon.js
Web xr:vr getting started
Minko - Windows App Meetup Nov. 2013
Metaverse building (blockchain, nft, 3d, vr)
G3m overview
Glob3 Mobile. Point Cloud Streaming
Vectorial Streaming. Como FOSS4G Europe 2015
Scenejs
Unleash 3D games with Babylon.js - JSConf 2014 talk
Azure Functions
HTML5: New UI Library for Games - Chad Austin
Writing native Linux desktop apps with JavaScript
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
Thinking cpu & memory - DroidCon Paris 18 june 2013
Amazon EKS: the good, the bad, and the ugly
Creating a third-person zombie horde shooter using DOTS – Unite Copenhagen
Going Mobile with AIR+Starling
From HTML to pixels on the Screen
Ad

Similar to Sergey Gonchar - Fast rendering with Starling (20)

PPTX
Penn graphics
PDF
Starling Deep Dive
PDF
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate Guide
PPTX
WebGL - It's GO Time
PPSX
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
PDF
HTML5 game dev with three.js - HexGL
PDF
Neurotech Solutions Ltd: Рекомендации по Stage3D: выбор наиболее подходящего ...
PDF
Starling基于stage3 d开发gpu加速的2d游戏
PPTX
FGS 2011: Flash+ A Whole New Dimension for Games
PPT
D3 D10 Unleashed New Features And Effects
PPTX
WebGL: The Next Generation
PPTX
Mantle for Developers
PDF
From Experimentation to Production: The Future of WebGL
PPTX
Optimizing Games for Mobiles
PDF
DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
PPTX
Advanced Mobile Optimizations
PDF
Demistifying the 3D Web
PDF
Demystifying the 3d web - Codemotion 2016
PDF
Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016
PPSX
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Penn graphics
Starling Deep Dive
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate Guide
WebGL - It's GO Time
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
HTML5 game dev with three.js - HexGL
Neurotech Solutions Ltd: Рекомендации по Stage3D: выбор наиболее подходящего ...
Starling基于stage3 d开发gpu加速的2d游戏
FGS 2011: Flash+ A Whole New Dimension for Games
D3 D10 Unleashed New Features And Effects
WebGL: The Next Generation
Mantle for Developers
From Experimentation to Production: The Future of WebGL
Optimizing Games for Mobiles
DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
Advanced Mobile Optimizations
Demistifying the 3D Web
Demystifying the 3d web - Codemotion 2016
Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Ad

Recently uploaded (20)

PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
PPT on Performance Review to get promotions
PPTX
Sustainable Sites - Green Building Construction
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Construction Project Organization Group 2.pptx
PDF
Well-logging-methods_new................
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPT
Mechanical Engineering MATERIALS Selection
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
composite construction of structures.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPT on Performance Review to get promotions
Sustainable Sites - Green Building Construction
Foundation to blockchain - A guide to Blockchain Tech
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Internet of Things (IOT) - A guide to understanding
UNIT 4 Total Quality Management .pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Arduino robotics embedded978-1-4302-3184-4.pdf
Construction Project Organization Group 2.pptx
Well-logging-methods_new................
CH1 Production IntroductoryConcepts.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Mechanical Engineering MATERIALS Selection
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
composite construction of structures.pdf

Sergey Gonchar - Fast rendering with Starling