OpenGL with Qt 5. Qt Developer Days, Berlin Presented by Sean Harmer. Produced by Klarälvdalens Datakonsult AB

Similar documents
Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

CPSC 436D Video Game Programming

Mali & OpenGL ES 3.0. Dave Shreiner Jon Kirkham ARM. Game Developers Conference 27 March 2013

Rendering Objects. Need to transform all geometry then

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

Starting out with OpenGL ES 3.0. Jon Kirkham, Senior Software Engineer, ARM

Coding OpenGL ES 3.0 for Better Graphics Quality

OpenGL Status - November 2013 G-Truc Creation

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

The Graphics Pipeline

Working with Metal Overview

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

Why modern versions of OpenGL should be used Some useful API commands and extensions

GLSL Overview: Creating a Program

Copyright Khronos Group Page 1

CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL

Ciril Bohak. - INTRODUCTION TO WEBGL

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

3D Graphics and OpenGl. First Steps

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

CS475/CS675 - Computer Graphics. OpenGL Drawing

Profiling and Debugging Games on Mobile Platforms

Quick Shader 0.1 Beta

Programming shaders & GPUs Christian Miller CS Fall 2011

Understanding M3G 2.0 and its Effect on Producing Exceptional 3D Java-Based Graphics. Sean Ellis Consultant Graphics Engineer ARM, Maidenhead

Dave Shreiner, ARM March 2009

CENG 477 Introduction to Computer Graphics. Graphics Hardware and OpenGL

3d Programming I. Dr Anton Gerdelan

last time put back pipeline figure today will be very codey OpenGL API library of routines to control graphics calls to compile and load shaders

Programming with OpenGL Part 3: Shaders. Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Beginning Direct3D Game Programming: 1. The History of Direct3D Graphics

Get the most out of the new OpenGL ES 3.1 API. Hans-Kristian Arntzen Software Engineer

GPU Memory Model. Adapted from:

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

object (say a cube) will be made up of triangles, each with three vertices, each with known object coordinates.

Lecture 13: OpenGL Shading Language (GLSL)

Shaders. Slide credit to Prof. Zwicker

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

OPENGL RENDERING PIPELINE

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Standards for WebVR. Neil Trevett. Khronos President Vice President Mobile Content,

GPU Quality and Application Portability

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

SHADER PROGRAMMING. Based on Jian Huang s lecture on Shader Programming

Accelerating Realism with the (NVIDIA Scene Graph)

COMP371 COMPUTER GRAPHICS

PowerVR Framework. October 2015

OpenGL BOF Siggraph 2011

RenderMonkey 1.6. Natalya Tatarchuk ATI Research

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1

CSE 167: Introduction to Computer Graphics Lecture #7: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

Free Downloads OpenGL ES 3.0 Programming Guide

Could you make the XNA functions yourself?

OpenGL Programmable Shaders

Mobile Application Programing: Android. OpenGL Operation

Name. EE 4702 Final Exam. Friday, 7 December 2012, 12:30-14:30 CST. Exam Total. Alias. (100 pts) Good Luck!

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

OpenGL Performances and Flexibility

More frames per second. Alex Kan and Jean-François Roy GPU Software

CSE 4431/ M Advanced Topics in 3D Computer Graphics. TA: Margarita Vinnikov

Vulkan and Animation 3/13/ &height=285&playerId=

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

The Ultimate Developers Toolkit. Jonathan Zarge Dan Ginsburg

PERFORMANCE OPTIMIZATIONS FOR AUTOMOTIVE SOFTWARE

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

Mobile Performance Tools and GPU Performance Tuning. Lars M. Bishop, NVIDIA Handheld DevTech Jason Allen, NVIDIA Handheld DevTools

Shader Programs. Lecture 30 Subsections 2.8.2, Robb T. Koether. Hampden-Sydney College. Wed, Nov 16, 2011

Introductory Seminar

CS770/870 Fall 2015 Advanced GLSL

Com S 336 Final Project Ideas

Sign up for crits! Announcments

CS 432 Interactive Computer Graphics

CS452/552; EE465/505. Image Processing Frame Buffer Objects

Best practices for effective OpenGL programming. Dan Omachi OpenGL Development Engineer

GDC 2014 Barthold Lichtenbelt OpenGL ARB chair

PowerVR: Getting Great Graphics Performance with the PowerVR Insider SDK. PowerVR Developer Technology

GeForce3 OpenGL Performance. John Spitzer

Shaders. Introduction. OpenGL Grows via Extensions. OpenGL Extensions. OpenGL 2.0 Added Shaders. Shaders Enable Many New Effects

3D Modeling. 3D Modeling 1

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

OpenGL ES 2.0 : Start Developing Now. Dan Ginsburg Advanced Micro Devices, Inc.

Compute Shaders. Christian Hafner. Institute of Computer Graphics and Algorithms Vienna University of Technology

CS 548: COMPUTER GRAPHICS PORTRAIT OF AN OPENGL PROGRAM SPRING 2015 DR. MICHAEL J. REALE

CS 432 Interactive Computer Graphics

LPGPU Workshop on Power-Efficient GPU and Many-core Computing (PEGPUM 2014)

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

Tips for game development: Graphics, Audio, Sensor bada Developer Day in Seoul Dec 08, 2010

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

Computer Science 175. Introduction to Computer Graphics lib175 time: m/w 2:30-4:00 pm place:md g125 section times: tba

CS452/552; EE465/505. Finale!

Real-Time Reyes: Programmable Pipelines and Research Challenges. Anjul Patney University of California, Davis

WebGL and GLSL Basics. CS559 Fall 2016 Lecture 14 October

Mobile Application Programing: Android. OpenGL Operation

Shader Programming. Daniel Wesslén, Stefan Seipel, Examples

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Next Generation OpenGL Neil Trevett Khronos President NVIDIA VP Mobile Copyright Khronos Group Page 1

Transcription:

Qt Developer Days, Berlin 2012 Presented by Sean Harmer Produced by Klarälvdalens Datakonsult AB Material based on Qt 5.0, created on November 9, 2012

QtQuick 2 and OpenGL The Future Module: 2/18

QtQuick 2 and OpenGL The Future Module: 3/18

What is OpenGL? Family of APIs for 2D and 3D rendering Very flexible Massive computational power Industry standard Cross-platform Actively developed http://www.khronos.org/ Extensible What is OpenGL? 4/18

What is it used for? What is OpenGL used/good for? Computer Aided Design Content creation Data visualisation Games Image processing Simulation 5/18

Hello Triangle Example Application setup Window creation Context creation Build an OpenGL pipeline Prepare geometry Feed data Ḍemo opengl/shader-fundamentals/ex_basic_usage 6/18

Simplified OpenGL Pipeline 7/18

Application Tasks Create window and OpenGL context Create per-vertex data Configure OpenGL state Create shader programs Create Vertex Buffer Objects (VBOs)... Create the pipeline and configure it Kickoff the drawing! Update AI, physics, application state, make coffee... 8/18

Shader Interfaces cont'd. 9/18

Shaders can have constant variables: const float pi = 3.14159; const vec2 resolution = vec2( 1024.0, 768.0 ); VBOs can hold per-vertex attributes: Varying Degrees of Change m_colors.create(); m_colors.setusagepattern( QOpenGLBuffer::StaticDraw ); m_colors.bind(); m_colors.allocate( colordata, 3 * 3 * sizeof( float ) ); What about in between these extremes? Ḍemo opengl/shader-fundamentals/ex_shader_uniform 10/18

Gui vs Widgets QOpenGL* vs QGL* Rule of thumb: Prefer QOpenGL* 11/18

Summary OpenGL windows and contexts Pipeline is programmable via shaders Shaders are compiled and linked Use Vertex Buffer Objects (VBOs) for speed Enable VBOs to match Vertex Shader interface Draw with gldrawarrays() or gldrawelements() Shader programs are configurable via uniform variables 12/18

QtQuick 2 and OpenGL The Future Module: QtQuick 2 and OpenGL 13/18

QtQuick 2 built on top of OpenGL renderer QDeclarativeView (QQ1) QQuickView (QQ2) Much in common... Can we integrate it? Several approaches OpenGL underlay OpenGL overlay Framebuffer Objects Custom QtQuick2 Items ShaderEffect item QtQuick 2 and OpenGL Ḍemo opengl/qtquick2-integration/ex_basic_integration Ḍemo opengl/qtquick2-integration/ex_updates QtQuick 2 and OpenGL 14/18

QtQuick 2/OpenGL Integration Don't clear! Receive notification Borrow the QtQuick2 OpenGL context Set state and draw stuff Reset state Return context in condition we found it No Vertex Buffer Objects bound No Index Buffer bound No Shader Program bound Restore texture unit configuration Don't forget sampler objects! QtQuick 2 and OpenGL 15/18

QtQuick 2 built on OpenGL 2.x (or OpenGL ES 2) Must be compatible with QtQuick 2's needs Compatibility Profile QSurfaceFormat and QWindow::setFormat() Same rules apply Now we can take advantage of new features! Export objects/types to QML Using a Custom Context Ḍemo opengl/qtquick2-integration/ex_custom_context Ḍemo opengl/qtquick2-integration/ex_qq2ui Ḍemo opengl/qtquick2-integration/ex_qq2ui_uniforms QtQuick 2 and OpenGL 16/18

QtQuick 2 and OpenGL The Future Module: The Future 17/18

Version functions and extensions Vertex Array Objects (VAOs) Transform feedback objects Texture/Sampler objects Geometry, Tessellation, and Compute Shader support Atomic counters, fences Query objects - timing, occlusion Debugging/profiling support... Qt 5.1 and Beyond The Future 18/18