Hands-On Workshop: An Introduction to OpenVG

Similar documents
Hardware Accelerated Graphics for High Performance JavaFX Mobile Applications

Mali. GPU OpenVG. Application Development Guide. Copyright ARM Limited. All rights reserved. ARM DUI 0380D (ID121709)

Hands-On Workshop: 3D Automotive Graphics on Connected Radios Using Rayleigh and OpenGL ES 2.0

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

Coding OpenGL ES 3.0 for Better Graphics Quality

The Application Stage. The Game Loop, Resource Management and Renderer Design

Core Graphics and OpenGL ES. Dr. Sarah Abraham

Hands-On Workshop: Memory Configuration and Throughput

Module 13C: Using The 3D Graphics APIs OpenGL ES

POWERVR MBX & SGX OpenVG Support and Resources

Whiz-Bang Graphics and Media Performance for Java Platform, Micro Edition (JavaME)

Software Engineering. ò Look up Design Patterns. ò Code Refactoring. ò Code Documentation? ò One of the lessons to learn for good design:

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

Could you make the XNA functions yourself?

Bringing it all together: The challenge in delivering a complete graphics system architecture. Chris Porthouse

Shaders. Slide credit to Prof. Zwicker

Spring 2011 Prof. Hyesoon Kim

Overview. Technology Details. D/AVE NX Preliminary Product Brief

OpenGL ES update. Eisaku Ohbuchi Digital Media Professionals Inc.

Applications and Implementations

Spring 2009 Prof. Hyesoon Kim

Ciril Bohak. - INTRODUCTION TO WEBGL

Lecturer Athanasios Nikolaidis

Dave Shreiner, ARM March 2009

Video Xpress Quick Startup Guide

Mattan Erez. The University of Texas at Austin

Hot Chips Bringing Workstation Graphics Performance to a Desktop Near You. S3 Incorporated August 18-20, 1996

Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012

Bringing AAA graphics to mobile platforms. Niklas Smedberg Senior Engine Programmer, Epic Games

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Programming Guide. Aaftab Munshi Dan Ginsburg Dave Shreiner. TT r^addison-wesley

Working with Metal Overview

An Introduction to OpenVG

Microbee Technology FTM-3SE

CS451Real-time Rendering Pipeline

Scanline Rendering 2 1/42

Overview of the OpenVG, a vector graphics API and Introduction to IWAYAG, an native OpenVG accelerator

Open GL Framework For A Computer Graphics Course

Quick Start Guide. TWR-KV10Z32 Development Kit for Kinetis KV1x Family TOWER SYSTEM

RSX Best Practices. Mark Cerny, Cerny Games David Simpson, Naughty Dog Jon Olick, Naughty Dog

COMP371 COMPUTER GRAPHICS

ADOBE 9A After Effects(R) CS3 ACE. Download Full Version :

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

Windowing System on a 3D Pipeline. February 2005

Blis: Better Language for Image Stuff Project Proposal Programming Languages and Translators, Spring 2017

3-D Accelerator on Chip

Introduction. What s New in This Edition

Chapter Answers. Appendix A. Chapter 1. This appendix provides answers to all of the book s chapter review questions.

How to draw and create shapes

Introduction to Embedded Graphics with Freescale Devices

Rendering Objects. Need to transform all geometry then

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

9 Using Appearance Attributes, Styles, and Effects

OpenGL on Android. Lecture 7. Android and Low-level Optimizations Summer School. 27 July 2015

Optimizing and Profiling Unity Games for Mobile Platforms. Angelo Theodorou Senior Software Engineer, MPG Gamelab 2014, 25 th -27 th June

Real - Time Rendering. Pipeline optimization. Michal Červeňanský Juraj Starinský

NVIDIA Parallel Nsight. Jeff Kiel

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

The Rendering Pipeline (1)

Grafica Computazionale: Lezione 30. Grafica Computazionale. Hiding complexity... ;) Introduction to OpenGL. lezione30 Introduction to OpenGL

CS Computer Graphics: Raster Graphics, Part 3

Getting Started with Freescale MQX RTOS for Kinetis SDK and Kinetis Design Studio IDE

Quick Start Guide. TWR-VF65GS10 For Vybrid Controller Solutions Based on ARM Cortex -A5 and Cortex-M4 Processors with the DS-5 Toolchain TOWER SYSTEM

CS 4620 Program 3: Pipeline

Hands-On Workshop: Freescale Audio Solution Framework, Part 2

3D Rendering Pipeline

Freescale MQX USB Stack for TWR-K24F120M GA User s Guide

CS559 Computer Graphics Fall 2015

Real Time Rendering of Complex Height Maps Walking an infinite realistic landscape By: Jeffrey Riaboy Written 9/7/03

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

Computer Graphics Coursework 1

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

Institutionen för systemteknik

What was removed? (1) OpenGL ES vs. OpenGL

Profiling and Debugging Games on Mobile Platforms

the gamedesigninitiative at cornell university Lecture 14 2D Sprite Graphics

Illustrator 1 Object Creation and Modification Tools

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

GPU Memory Model. Adapted from:

2D ANIMATION & INTERACTION COURSE WEEK 5 QUICK REFERENCE

CS130 : Computer Graphics Lecture 2: Graphics Pipeline. Tamar Shinar Computer Science & Engineering UC Riverside

Project 1, 467. (Note: This is not a graphics class. It is ok if your rendering has some flaws, like those gaps in the teapot image above ;-)

Adobe Flash Course Syllabus

Using the History Palette Part 2 - Create & Convert Quick Scripts

Computer Graphics - Treasure Hunter

gltf 2.0: Status and Outlook

World Coordinate System

Normalized Device Coordinate System (NDC) World Coordinate System. Example Coordinate Systems. Device Coordinate System

RENDERING TECHNIQUES

NVIDIA nfinitefx Engine: Programmable Pixel Shaders

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 1 The Blender Interface and Basic Shapes

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Introduction to Shaders.

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Module Introduction. Content 15 pages 2 questions. Learning Time 25 minutes

Integration for CodeBlocks

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker

Computer Graphics. Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1

In this lesson, you ll learn how to:

Coming to a Pixel Near You: Mobile 3D Graphics on the GoForce WMP. Chris Wynn NVIDIA Corporation

Transcription:

Hands-On Workshop: An Introduction to OpenVG FTF-AUT-F0342 Steve McAslan Senior Member of Technical Staff A P R. 2 0 1 4 TM External Use

Agenda Introduction to computer graphics and the 2D-ACE Hands-on 1 Creating graphics using vectors Hands-on 2 Fills and strokes Hands-on 3 Transformations Hands-on 4 Combining techniques Hands-on 5 and 6 External Use 1

Introduction to Computer Graphics Computer graphics consist of a data set stored in memory which contains information about appearance of colored pixels on a display panel Source data sets can be stored in various different ways including vector graphics and compressed formats (MPEG) In the vast majority of cases, the final data set is stored as a raster graphic In this session we will only create these raster graphics by drawing them using the OpenVG vector language External Use 2

Raster Graphics Each location in memory contains information for a single pixel on the display panel The size of the location in memory can vary from a single bit to a full 32-bit word This bits per pixel value determines how much memory is required to stored the graphic External Use 3

The 2D-ACE Displays Raster Graphics Memory DCU External Use 4

Example 1 Getting Started Requirements: Software (already installed on PC) IAR Compiler v6.70 Example projects and debugger scripts (found at C:\FTF_AUT_F0342 ) Hardware Vybrid Tower Card (TWR-VF65GS10) Tower Elevator Card (TWR-ELEV) LCD Display Card (TWR-LCD-RGB) Segger Jlink-Lite debugger The tower card is powered by via USB. Cable should be connected to the micro USB connector (J3) closest to the elevator card. External Use 5

Example 1 Launching Project 1. C:\ FTF-AUT-F0342\HandsOnProjects\HandsOnn\build-twrvf600-mqx-a5\iar\ contains the project file: twrvf600.eww. This will launch the IAR IDE which will be used for compiling and debugging for this class. A screen shot of IAR in compiler mode can be seen below: Make Download and Debug Set breakpoint by clicking in margin Files used in project External Use 6

Example 1 Launching Project 2. Click the Download and Debug button to launch the debug interface Break Step/Over /Into etc Quit Debugger! Use view to open memory/registers etc. If changes have been made to code, press to recompile and d/load Reset External Use 7 Memory Window

Hands-On 1 External Use 8

Hands-on 1: Task list Download code and run Stop execution and bring up DCU0 Layers 20 22 Enable layer 22 by setting EN bit Enable layer 20 Move planet by setting DCU0_CTRLDESCL20_2 to 0x00000000 Adjust position of planet by adjusting POSX and POSY fields Enable layer 21 Adjust layer 21 TRANS value between 0 and 255 (0xFF) Bring up DCU0 layers 10-19 Enable layer 10 Move layer 10 around Finish by executing code - this performs the animation by doing exactly what we did by hand External Use 9

Introducing OpenVG OpenVG is a standard API for hardware-accelerated 2D graphics Managed by not-for-profit Khronos Group (also OpenGL) Royalty-free, open standard Designed for embedded systems Draws vector graphics and manipulates 2D images The OpenVG API natively supports Lines, curves, paths Images Filters, masks Paint (gradients & textures) Blending Transformations External Use 10

OpenVG Programming Model OpenVG is designed around a state machine-based client-server model User sets and gets variables in the machine (enable/disable, bind, etc.) Application vgget/vgset OpenVG Stack Context - State OpenVG: handles paints, paths, gradients, etc., to avoid re-preprocessing each frame Data types in a function are determined by i, f, or v postfix Integer, float, or vector Execution decoupled Execution is only guaranteed when user blocks (vgfinish) or flips the drawing surfaces (eglswapbuffers) External Use 11

Creating Drawing Surfaces Using EGL OpenVG needs a surface to draw on, and EGL provides that EGL defines three types of surfaces: Windows: used for onscreen rendering Pbuffers: used for offscreen rendering Pixmaps: used for offscreen rendering into buffers that can be used by other native APIs The EGL API is also defined by the Khronos group External Use 12

Creating paths Create a window using EGL Create an empty Path that will accept segment data vgcreatepath. Fill Segment and point data to the path vgappendpathdata. Once created draw the path using vgdrawpath. For convenience We perform the path creation tasks in OvgApp_Init() We do the drawing in OvgApp_Draw() External Use 13

Hands-On 2 External Use 14

Converting to a diamond VGbyte vgtrianglesegments[] = { VG_MOVE_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS, VG_CLOSE_PATH, }; VGbyte vgtrianglesegments[] = { VG_MOVE_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS, VG_CLOSE_PATH, }; VGfloat vgtrianglepoints[] = { /* VG_MOVE_TO_ABS consumes 2 */ 60.0f, 50.0f, /* VG_LINE_TO_ABS consumes 2 */ 180.0f, 100.0f, /* VG_LINE_TO_ABS consumes 2 */ 300.0f, 50.0f, }; VGfloat vgtrianglepoints[] = { /* VG_MOVE_TO_ABS consumes 2 */ 60.0f, 50.0f, /* VG_LINE_TO_ABS consumes 2 */ 180.0f, 100.0f, /* VG_LINE_TO_ABS consumes 2 */ 300.0f, 50.0f, /* VG_LINE_TO_ABS consumes 2 */ 180.0f, 0.0f, }; vgappendpathdata(vgtriangle, 4,... vgappendpathdata(vgtriangle, 5,... External Use 15

Fills and strokes Paints are used to define the color and pattern that the stroke and interior of a path will have They define a color and an alpha value for each pixel being drawn The steps to use a paint are similar than those of a Path Create an empty Paint that will accept paint parameters information vgcreatepaint. Set parameters for the paint type. vgsetparameteri(#name_of_paint#, VG_PAINT_TYPE. Set the parameter data for the selected paint type (In this case the type paint is color): vgsetcolor((#name_of_paint#, 0x0000FFFF); The vgdrawpath command can draw path outlines as we ve seen or the path filled (or both) External Use 16

Hands-On 3 External Use 17

Hands-on 3: Adjusting strokes and fills Swap vgtriangle and vgtriangle2 drawing order See how the drawing order affects the final image Reconfigure strokepaint to draw each figure with a different colored and sized outline Give the figures different fill colors External Use 18

Transformations Up to now we have been using a 1 to 1 relationship between OpenVG coordinates and the drawing surface In fact all OpenVG drawing operations pass through a transformation matrix In the examples so far the matrix is set to the identity matrix to give us the 1 to 1 translation Paths, strokes, fills, images and glyphs have their own transformation matrices There are special concatenated matrix combinations for common transformations vgrotate, vgscale, vgshear, vgtranslate Transformations are essential if you plan to include animate using OpenVG within your application External Use 19

Hands-On 4 External Use 20

Hands-on 4: Transformations Apply the transformations to the triangles to see the effect vgscale(float x, float y) Scales x and y by their respective factors vgrotate(float angle) Rotates counter-clockwise by angle degrees vgtranslate(float x, float y) Shifts the origin by (x,y) vgshear(float x, float y) Applies a shear in the respective direction vgloadidentity() Restore the transformation to 1:1 External Use 21

Combining techniques The final examples combine the various techniques We will use pre-rendered graphics alongside OpenVG generated graphics to create an optimised output This approach is beneficial because it reduces the processing load on the OpenVG system with no loss in quality at the output External Use 22

Hands-On 5 and 6 External Use 23

Hands-on 5: Slide status and graphics The application displays a slider which moves from minimum to maximum The value of the slider is passed to the OvgApp_Draw function as the parameter adjust Use this value to process one or more of the simple graphics on the left hand side of the screen In this example the application is forced to use a single buffer for all OpenVG processing Output becomes very choppy Disable this restriction by commenting out this line in ovgmain.c fb_info1.buf_count = 1; External Use 24

Hands-on 6: Album art This example has a more complex OpenVG manipulation of prerendered graphics. Using vgscale, vgrotate and vgtranslate The background to the image is removed using alpha blending which allows the 2D-ACE to control what is in the background The project simply changes the color Additionally the 2D-ACE modifies the alpha channel of the OpenVG graphics Independently to the OpenVG animation The 2D-ACE also captures the currently selected album art This would allow the image of the playing song to be displayed by the 2D-ACE while having an independent animation for selection External Use 25

Summary The OpenVG standard allows graphics to be created using a vector language Complex graphics can be created by combing paths, strokes and fills Raster graphics can also be manipulated by the OpenVG GPU Combining the 2D-ACE capability with the OpenVG process allows for a wider range of graphic capability and better use of processing power There is little point in using OpenVG to render a scene that is static External Use 26

www.freescale.com 2014 Freescale Semiconductor, Inc. External Use