SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
How to build your own OpenGL on ARM devices
without GPU
Danylo Ulianych
RingLabs
STM32 are not designed for 3D graphics
3D games Orientation,
navigation
Motion capture
Why OpenGL? Analogs.
https://github.com/fabio914/arduinogl
Pros:
★ OpenGL syntax
gluLookAt(10, 8, -10, 0, 0, 0, 0, 1, 0);
★ Ported on Arduino (!)
Cons:
Not able to fill polygons (it draws only edges)
No depth buffer (rear objects should not be
drawn)
No color buffer ⇒ no color gradient
Why OpenGL? Analogs.
https://github.com/floppes/stm32doom
The basic rendering concept -- horizontal and
vertical lines of constant Z. Binary Space
Partitioning (BSP) constructs a balanced tree of
polygons per vertical column to draw a wall.
Pros:
★ Real-time performance on STM32 Disco
★ IO layer, responsible for handling user
events, is built into graphics engine ⇒
low latency
Cons:
Only 2 degrees of freedom: camera
cannot look up and down
You have to be John Carmack (the
creator of Doom engine) to understand it
Why OpenGL? Motivation.
OpenGL is meant to be cross-platform API. But it requires
GPU. I didn’t find OpenGL v1.0+ sources for running on
CPU only - without GPU, platform specific window context.
3D graphics is not 2D graphics!
2D graphics works with widgets.
It’s much simpler than 3D
graphics, because:
● Most LCD manufacturers
(even low-cost LCD)
provide rules for fast
drawing of horizontal and
vertical lines, rectangles -
instead of pixel by pixel.
● Redraw only when a new
event is occurred.
3D graphics is not 2D graphics!
Complexity (lower bound):
● time: width x height x (objects in the scene)
● space: width x height
Crysis uses ~ 3 millions polygons per frame
Our plan
1. Choose a programming board.
2. Choose software tools (linear algebra, HAL).
3. Mesh.
4. Model, view and projection matrices.
5. Visibility problem. Depth buffer.
6. Plugging it all together.
7. Benchmarks.
What you’re gonna need. Hardware.
STM32
Discovery
What you’re gonna need. Software.
Hardware abstraction layer to
“speak” with peripherals
(optional) Board support package to draw
on LCD
Linear algebra library (affine
transformations) ← ???
Linear algebra library
https://github.com/datenwolf/linmath.h
246 stars, under “DO WHAT THE F**K YOU WANT TO PUBLIC LICENSE”
Linear algebra library
https://github.com/datenwolf/linmath.h
246 stars, under “DO WHAT THE F**K YOU WANT TO PUBLIC LICENSE”
Our plan
✓ Choose a programming board.
✓ Choose software tools (linear algebra, HAL).
➢ Mesh.
● Model, view and projection matrices.
● Visibility problem. Depth buffer.
● Plugging it all together.
● Benchmarks.
Mesh Each 3D object can be
decomposed into a series
of polygons (triangles),
called mesh. To construct
a mesh, you need to
specify position and color
for each vertex in a mesh.
Then any intermediate
point inside a triangle
can be interpolated as the
average of its vertices
colors.
Affine matrix representation
Rotate by
degrees around
vertical Z-axis
Here is where
we’re gonna
use our linear
algebra library
a lot!
ModelView matrix
● Model matrix defines
position and orientation
of the duck
● View matrix defines
position and orientation
of the camera
If we place the camera into
the origin of our coordinate
system, then
View == I4x4
ModelView == Model
ModelView4x4
≝ View4x4
✕ Model4x4
Projection matrix
“Eye” and “camera”
are used
interchangeably - it
defines the point of
view or how we will
see a 3D scene.
Total MVP matrix
MVP4x4
≝ Projection4x4
✕ View4x4
✕ Model4x4
MVP defines what you see on your smartphone screen.
It squashes 3D space into 2D screen.
Our plan
✓ Choose a programming board.
✓ Choose software tools (linear algebra, HAL).
✓ Mesh.
✓ Model, view and projection matrices.
➢ Visibility problem. Depth buffer.
● Plugging it all together.
● Benchmarks.
Visibility problem. Depth Buffer.
We need to store the current depth and
color values for each pixel on the
screen.
For LCD 320x240 it’s
320x240x8 (4 bytes for depth float and
4 bytes for RGB8888) == 614 Kb > 256
Kb (internal RAM), thus we need
SDRAM.
Direct memory access (DMA) trick
Direct memory access (DMA) trick
Plugging it all together
SDRAM
Plugging it all together
Benchmark
Benchmark is measured by FPS (frames per
second) on the scene with 3 cubes with
asserts turned off.
Optimization
flag
-O0 -Os -O1 -O2 -O3 -O3 FrameBuffer clearing
only (both depth and color)
[upper bound for FPS]
FPS 1.25 5.38 6.10 7.81 8.48 139.82
So close!
Reality…
https://github.com/dizcza/cOpenGLWhat you imagine...

Mais conteúdo relacionado

Mais procurados

OpenGL ES for iOS (3D Graphics)
OpenGL ES for iOS (3D Graphics)OpenGL ES for iOS (3D Graphics)
OpenGL ES for iOS (3D Graphics)
inquinity
 
Shaders in Unity by Zoel
Shaders in Unity by ZoelShaders in Unity by Zoel
Shaders in Unity by Zoel
Agate Studio
 
3D Graphics
3D Graphics3D Graphics
3D Graphics
ViTAly
 
Canvas: we must go deeper
Canvas: we must go deeper Canvas: we must go deeper
Canvas: we must go deeper
ardcore
 

Mais procurados (20)

[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
 
OpenGL ES for iOS (3D Graphics)
OpenGL ES for iOS (3D Graphics)OpenGL ES for iOS (3D Graphics)
OpenGL ES for iOS (3D Graphics)
 
Shaders in Unity by Zoel
Shaders in Unity by ZoelShaders in Unity by Zoel
Shaders in Unity by Zoel
 
Realism in Computer Graphics
Realism in Computer GraphicsRealism in Computer Graphics
Realism in Computer Graphics
 
Praseed Pai
Praseed PaiPraseed Pai
Praseed Pai
 
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
Learn how to do stylized shading with Shader Graph – Unite Copenhagen 2019
 
3 d
3 d3 d
3 d
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Open Graphics Library
Open Graphics  Library Open Graphics  Library
Open Graphics Library
 
3D Graphics
3D Graphics3D Graphics
3D Graphics
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011
 
computer graphics
computer graphicscomputer graphics
computer graphics
 
Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...
 
Canvas: we must go deeper
Canvas: we must go deeper Canvas: we must go deeper
Canvas: we must go deeper
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
Best Practices for Shader Graph
Best Practices for Shader GraphBest Practices for Shader Graph
Best Practices for Shader Graph
 
Volodymyr Lyubinets “Generative models for images”
Volodymyr Lyubinets  “Generative models for images”Volodymyr Lyubinets  “Generative models for images”
Volodymyr Lyubinets “Generative models for images”
 
【Unite 2017 Tokyo】シェーダープログラミング入門!カスタムシェーダー、作るで!
【Unite 2017 Tokyo】シェーダープログラミング入門!カスタムシェーダー、作るで!【Unite 2017 Tokyo】シェーダープログラミング入門!カスタムシェーダー、作るで!
【Unite 2017 Tokyo】シェーダープログラミング入門!カスタムシェーダー、作るで!
 
1 introduction computer graphics
1 introduction computer graphics1 introduction computer graphics
1 introduction computer graphics
 
AR Foundation framework: product roadmap – Unite Copenhagen 2019
AR Foundation framework: product roadmap – Unite Copenhagen 2019AR Foundation framework: product roadmap – Unite Copenhagen 2019
AR Foundation framework: product roadmap – Unite Copenhagen 2019
 

Semelhante a Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functional of projecting 3D meshes” {R0boCamp}

mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game development
David Galeano
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphics
changehee lee
 
thu-blake-gdc-2014-final
thu-blake-gdc-2014-finalthu-blake-gdc-2014-final
thu-blake-gdc-2014-final
Robert Taylor
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02
chon2010
 

Semelhante a Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functional of projecting 3D meshes” {R0boCamp} (20)

JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game development
 
2D graphics
2D graphics2D graphics
2D graphics
 
Advanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics APIAdvanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics API
 
ICS3211 lecture 08
ICS3211 lecture 08ICS3211 lecture 08
ICS3211 lecture 08
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
 
(2) gui drawing
(2) gui drawing(2) gui drawing
(2) gui drawing
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGL
 
Graphics Libraries
Graphics LibrariesGraphics Libraries
Graphics Libraries
 
Crossing the Resolution Divide
Crossing the Resolution DivideCrossing the Resolution Divide
Crossing the Resolution Divide
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORT
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphics
 
thu-blake-gdc-2014-final
thu-blake-gdc-2014-finalthu-blake-gdc-2014-final
thu-blake-gdc-2014-final
 
Computer graphics
Computer graphics Computer graphics
Computer graphics
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphics
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game Engines
 
(2) gui drawing
(2) gui drawing(2) gui drawing
(2) gui drawing
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02
 
Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2
 

Mais de Lviv Startup Club

Mais de Lviv Startup Club (20)

Artem Bykovets: 4 Вершники апокаліпсису робочих стосунків (+антидоти до них) ...
Artem Bykovets: 4 Вершники апокаліпсису робочих стосунків (+антидоти до них) ...Artem Bykovets: 4 Вершники апокаліпсису робочих стосунків (+антидоти до них) ...
Artem Bykovets: 4 Вершники апокаліпсису робочих стосунків (+антидоти до них) ...
 
Dmytro Khudenko: Challenges of implementing task managers in the corporate an...
Dmytro Khudenko: Challenges of implementing task managers in the corporate an...Dmytro Khudenko: Challenges of implementing task managers in the corporate an...
Dmytro Khudenko: Challenges of implementing task managers in the corporate an...
 
Sergii Melnichenko: Лідерство в Agile командах: ТОП-5 основних психологічних ...
Sergii Melnichenko: Лідерство в Agile командах: ТОП-5 основних психологічних ...Sergii Melnichenko: Лідерство в Agile командах: ТОП-5 основних психологічних ...
Sergii Melnichenko: Лідерство в Agile командах: ТОП-5 основних психологічних ...
 
Mariia Rashkevych: Підвищення ефективності розроблення та реалізації освітніх...
Mariia Rashkevych: Підвищення ефективності розроблення та реалізації освітніх...Mariia Rashkevych: Підвищення ефективності розроблення та реалізації освітніх...
Mariia Rashkevych: Підвищення ефективності розроблення та реалізації освітніх...
 
Mykhailo Hryhorash: What can be good in a "bad" project? (UA)
Mykhailo Hryhorash: What can be good in a "bad" project? (UA)Mykhailo Hryhorash: What can be good in a "bad" project? (UA)
Mykhailo Hryhorash: What can be good in a "bad" project? (UA)
 
Oleksii Kyselov: Що заважає ПМу зростати? Розбір практичних кейсів (UA)
Oleksii Kyselov: Що заважає ПМу зростати? Розбір практичних кейсів (UA)Oleksii Kyselov: Що заважає ПМу зростати? Розбір практичних кейсів (UA)
Oleksii Kyselov: Що заважає ПМу зростати? Розбір практичних кейсів (UA)
 
Yaroslav Osolikhin: «Неідеальний» проєктний менеджер: People Management під ч...
Yaroslav Osolikhin: «Неідеальний» проєктний менеджер: People Management під ч...Yaroslav Osolikhin: «Неідеальний» проєктний менеджер: People Management під ч...
Yaroslav Osolikhin: «Неідеальний» проєктний менеджер: People Management під ч...
 
Mariya Yeremenko: Вплив Генеративного ШІ на сучасний світ та на особисту ефек...
Mariya Yeremenko: Вплив Генеративного ШІ на сучасний світ та на особисту ефек...Mariya Yeremenko: Вплив Генеративного ШІ на сучасний світ та на особисту ефек...
Mariya Yeremenko: Вплив Генеративного ШІ на сучасний світ та на особисту ефек...
 
Petro Nikolaiev & Dmytro Kisov: ТОП-5 методів дослідження клієнтів для успіху...
Petro Nikolaiev & Dmytro Kisov: ТОП-5 методів дослідження клієнтів для успіху...Petro Nikolaiev & Dmytro Kisov: ТОП-5 методів дослідження клієнтів для успіху...
Petro Nikolaiev & Dmytro Kisov: ТОП-5 методів дослідження клієнтів для успіху...
 
Maksym Stelmakh : Державні електронні послуги та сервіси: чому бізнесу варто ...
Maksym Stelmakh : Державні електронні послуги та сервіси: чому бізнесу варто ...Maksym Stelmakh : Державні електронні послуги та сервіси: чому бізнесу варто ...
Maksym Stelmakh : Державні електронні послуги та сервіси: чому бізнесу варто ...
 
Alexander Marchenko: Проблеми росту продуктової екосистеми (UA)
Alexander Marchenko: Проблеми росту продуктової екосистеми (UA)Alexander Marchenko: Проблеми росту продуктової екосистеми (UA)
Alexander Marchenko: Проблеми росту продуктової екосистеми (UA)
 
Oleksandr Grytsenko: Save your Job або прокачай скіли до Engineering Manageme...
Oleksandr Grytsenko: Save your Job або прокачай скіли до Engineering Manageme...Oleksandr Grytsenko: Save your Job або прокачай скіли до Engineering Manageme...
Oleksandr Grytsenko: Save your Job або прокачай скіли до Engineering Manageme...
 
Yuliia Pieskova: Фідбек: не лише "як", але й "коли" і "навіщо" (UA)
Yuliia Pieskova: Фідбек: не лише "як", але й "коли" і "навіщо" (UA)Yuliia Pieskova: Фідбек: не лише "як", але й "коли" і "навіщо" (UA)
Yuliia Pieskova: Фідбек: не лише "як", але й "коли" і "навіщо" (UA)
 
Nataliya Kryvonis: Essential soft skills to lead your team (UA)
Nataliya Kryvonis: Essential soft skills to lead your team (UA)Nataliya Kryvonis: Essential soft skills to lead your team (UA)
Nataliya Kryvonis: Essential soft skills to lead your team (UA)
 
Volodymyr Salyha: Stakeholder Alchemy: Transforming Analysis into Meaningful ...
Volodymyr Salyha: Stakeholder Alchemy: Transforming Analysis into Meaningful ...Volodymyr Salyha: Stakeholder Alchemy: Transforming Analysis into Meaningful ...
Volodymyr Salyha: Stakeholder Alchemy: Transforming Analysis into Meaningful ...
 
Anna Chalyuk: 7 інструментів та принципів, які допоможуть зробити вашу команд...
Anna Chalyuk: 7 інструментів та принципів, які допоможуть зробити вашу команд...Anna Chalyuk: 7 інструментів та принципів, які допоможуть зробити вашу команд...
Anna Chalyuk: 7 інструментів та принципів, які допоможуть зробити вашу команд...
 
Oksana Smilka: Цінності, цілі та (де) мотивація (UA)
Oksana Smilka: Цінності, цілі та (де) мотивація (UA)Oksana Smilka: Цінності, цілі та (де) мотивація (UA)
Oksana Smilka: Цінності, цілі та (де) мотивація (UA)
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
 
Andrii Skoromnyi: Чому не працює методика "5 Чому?" – і яка є альтернатива? (UA)
Andrii Skoromnyi: Чому не працює методика "5 Чому?" – і яка є альтернатива? (UA)Andrii Skoromnyi: Чому не працює методика "5 Чому?" – і яка є альтернатива? (UA)
Andrii Skoromnyi: Чому не працює методика "5 Чому?" – і яка є альтернатива? (UA)
 
Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...
Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...
Maryna Sokyrko & Oleksandr Chugui: Building Product Passion: Developing AI ch...
 

Último

一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
uodye
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
ehyxf
 
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Escorts Service Sanjay Nagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Sanjay Nagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Sanjay Nagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Sanjay Nagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men 🔝kakinada🔝 Escor...
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men  🔝kakinada🔝   Escor...➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men  🔝kakinada🔝   Escor...
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men 🔝kakinada🔝 Escor...
amitlee9823
 
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
amitlee9823
 
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
amitlee9823
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 

Último (20)

Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
 
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
 
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
 
(ISHITA) Call Girls Service Aurangabad Call Now 8617697112 Aurangabad Escorts...
(ISHITA) Call Girls Service Aurangabad Call Now 8617697112 Aurangabad Escorts...(ISHITA) Call Girls Service Aurangabad Call Now 8617697112 Aurangabad Escorts...
(ISHITA) Call Girls Service Aurangabad Call Now 8617697112 Aurangabad Escorts...
 
Escorts Service Sanjay Nagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Sanjay Nagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Sanjay Nagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Sanjay Nagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men 🔝kakinada🔝 Escor...
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men  🔝kakinada🔝   Escor...➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men  🔝kakinada🔝   Escor...
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men 🔝kakinada🔝 Escor...
 
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
 
Escorts Service Daryaganj - 9899900591 College Girls & Models 24/7
Escorts Service Daryaganj - 9899900591 College Girls & Models 24/7Escorts Service Daryaganj - 9899900591 College Girls & Models 24/7
Escorts Service Daryaganj - 9899900591 College Girls & Models 24/7
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsDeira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
 
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 

Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functional of projecting 3D meshes” {R0boCamp}

  • 1. How to build your own OpenGL on ARM devices without GPU Danylo Ulianych RingLabs
  • 2. STM32 are not designed for 3D graphics 3D games Orientation, navigation Motion capture
  • 3. Why OpenGL? Analogs. https://github.com/fabio914/arduinogl Pros: ★ OpenGL syntax gluLookAt(10, 8, -10, 0, 0, 0, 0, 1, 0); ★ Ported on Arduino (!) Cons: Not able to fill polygons (it draws only edges) No depth buffer (rear objects should not be drawn) No color buffer ⇒ no color gradient
  • 4. Why OpenGL? Analogs. https://github.com/floppes/stm32doom The basic rendering concept -- horizontal and vertical lines of constant Z. Binary Space Partitioning (BSP) constructs a balanced tree of polygons per vertical column to draw a wall. Pros: ★ Real-time performance on STM32 Disco ★ IO layer, responsible for handling user events, is built into graphics engine ⇒ low latency Cons: Only 2 degrees of freedom: camera cannot look up and down You have to be John Carmack (the creator of Doom engine) to understand it
  • 5. Why OpenGL? Motivation. OpenGL is meant to be cross-platform API. But it requires GPU. I didn’t find OpenGL v1.0+ sources for running on CPU only - without GPU, platform specific window context.
  • 6. 3D graphics is not 2D graphics! 2D graphics works with widgets. It’s much simpler than 3D graphics, because: ● Most LCD manufacturers (even low-cost LCD) provide rules for fast drawing of horizontal and vertical lines, rectangles - instead of pixel by pixel. ● Redraw only when a new event is occurred.
  • 7. 3D graphics is not 2D graphics! Complexity (lower bound): ● time: width x height x (objects in the scene) ● space: width x height Crysis uses ~ 3 millions polygons per frame
  • 8. Our plan 1. Choose a programming board. 2. Choose software tools (linear algebra, HAL). 3. Mesh. 4. Model, view and projection matrices. 5. Visibility problem. Depth buffer. 6. Plugging it all together. 7. Benchmarks.
  • 9. What you’re gonna need. Hardware. STM32 Discovery
  • 10. What you’re gonna need. Software. Hardware abstraction layer to “speak” with peripherals (optional) Board support package to draw on LCD Linear algebra library (affine transformations) ← ???
  • 11. Linear algebra library https://github.com/datenwolf/linmath.h 246 stars, under “DO WHAT THE F**K YOU WANT TO PUBLIC LICENSE”
  • 12. Linear algebra library https://github.com/datenwolf/linmath.h 246 stars, under “DO WHAT THE F**K YOU WANT TO PUBLIC LICENSE”
  • 13. Our plan ✓ Choose a programming board. ✓ Choose software tools (linear algebra, HAL). ➢ Mesh. ● Model, view and projection matrices. ● Visibility problem. Depth buffer. ● Plugging it all together. ● Benchmarks.
  • 14. Mesh Each 3D object can be decomposed into a series of polygons (triangles), called mesh. To construct a mesh, you need to specify position and color for each vertex in a mesh. Then any intermediate point inside a triangle can be interpolated as the average of its vertices colors.
  • 15. Affine matrix representation Rotate by degrees around vertical Z-axis Here is where we’re gonna use our linear algebra library a lot!
  • 16. ModelView matrix ● Model matrix defines position and orientation of the duck ● View matrix defines position and orientation of the camera If we place the camera into the origin of our coordinate system, then View == I4x4 ModelView == Model ModelView4x4 ≝ View4x4 ✕ Model4x4
  • 17. Projection matrix “Eye” and “camera” are used interchangeably - it defines the point of view or how we will see a 3D scene.
  • 18. Total MVP matrix MVP4x4 ≝ Projection4x4 ✕ View4x4 ✕ Model4x4 MVP defines what you see on your smartphone screen. It squashes 3D space into 2D screen.
  • 19. Our plan ✓ Choose a programming board. ✓ Choose software tools (linear algebra, HAL). ✓ Mesh. ✓ Model, view and projection matrices. ➢ Visibility problem. Depth buffer. ● Plugging it all together. ● Benchmarks.
  • 20. Visibility problem. Depth Buffer. We need to store the current depth and color values for each pixel on the screen. For LCD 320x240 it’s 320x240x8 (4 bytes for depth float and 4 bytes for RGB8888) == 614 Kb > 256 Kb (internal RAM), thus we need SDRAM.
  • 21. Direct memory access (DMA) trick
  • 22. Direct memory access (DMA) trick
  • 23. Plugging it all together SDRAM
  • 24. Plugging it all together
  • 25.
  • 26. Benchmark Benchmark is measured by FPS (frames per second) on the scene with 3 cubes with asserts turned off. Optimization flag -O0 -Os -O1 -O2 -O3 -O3 FrameBuffer clearing only (both depth and color) [upper bound for FPS] FPS 1.25 5.38 6.10 7.81 8.48 139.82