Introduction to Opengl/GLSL and Webgl

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Opengl/GLSL and Webgl Introduction to OpenGL/GLSL and WebGL GLSL Objectives n Give you an overview of the software that you will be using this semester n OpenGL, WebGL, and GLSL n What are they? n How do you use them? n What does the code look like? n Evolution n All of them are required to write modern graphics code, although alternatives exist What is OpenGL? n An application programming interface (API) n A (low-level) Graphics rendering API n Generate high-quality images from geometric and image primitives Maximal Portability n Display device independent n Window system independent n Operating system independent Without a standard API (such as OpenGL) - impossible to port (100, 50) Line(100,50,150,80) - device/lib 1 (150, 100) Moveto(100,50) - device/lib 2 Lineto(150,100) Brief History of OpenGL n Originated from a proprietary API called Iris GL from Silicon Graphics, Inc. n Provide access to graphics hardware capabilities at the lowest possible level that still provides hardware independence n The evolution is controlled by OpenGL Architecture Review Board, or ARB. n OpenGL 1.0 API finalized in 1992, first implementation in 1993 n In 2006, OpenGL ARB became a worKgroup of the Khronos Group n 10+ revisions since 1992 OpenGL Evolution n 1.1 (1997): vertex arrays and texture objects n 1.2 (1998): 3D textures n 1.3 (2001): cubemap textures, compressed textures, multitextures n 1.4 (2002): mipmap Generation, shadow map textures, etc n 1.5 (2003): vertex buffer object, shadow comparison functions, occlusion queries, non- power-of-2 textures OpenGL Evolution n 2.0 (2004): vertex and fragment shading (GLSL 1.1), multiple render targets, etc n 2.1 (2006): GLSL 1.2, pixel buffer objects, etc n 3.0 (2008): GLSL 1.3, deprecation model, etc n 3.1 (2009): GLSL 1.4, texture buffer objects, move much of deprecated functions to ARB compatible extension n 3.2 (2009) n 4.X (2012 and on) OpenGL Basics n OpenGL’s primary function – Rendering n Rendering? – converting geometric/mathematical object descriptions into frame buffer values n OpenGL can render: n Geometric primitives n Bitmaps and Images (Raster primitives) OpenGL Example Cube with flat color Cube with lighting Cube with textures WebGL n JavaScript implementation of OpenGL n Run in all modern browsers (Chrome, Safari, Firefox, IE, etc). n Application can be located on a remote server n Rendering is done within browser using local hardware n Uses HTML5 canvas n Integrated with standard Web packages and apps (CSS, jQuery, etc.) What do you need to know n Web Environment and Execution n Modern OpenGL basics n Pipeline architecture n Shaders (vertex and fragment) based OpenGL n OpenGL Shading Language (GLSL) n Javascript OpenGL ES and WebGL n OpenGL ES n A subset of OpenGL 3.1 API (lightweight) n Designed for embedded system (mobile phones etc.) n Shader based n WebGL n Javascript implementation of ES 2.0 n Runs on browswers WebGL Rendering Pipeline WebGL Programming n General Structure: n Set up canvas to render to n Generate data/geometry in application n Create shader programs n Create buffer objects and load data to them n Connect buffer objects and data to shader variables n Set up proper viewing and lighting conditions n Render WebGL Programming n WebGL needs a place to render into n HTML5 canvas element n All the code can be put in a single HTML file n Or you can put setup code in an HTML file and your application code in separate Javascript files n HTML file includes shaders n HTML file reads in application and utilities Example 0 n A very simple example that creates a canvas but display nothing except a yellow background <!DOCTYPE html> <html> <head> <title>hwshen WebGL &mdash; code00 </title> WebGL <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> Javascript <script type="text/javascript" src="code00.js"></script> </head> <body onload="webGLStart();”> canvas <canvas id="code00-canvas" style="border: none;" width="700" height="500"></canvas> <br/> </body> </html> code00.js var gl; function webGLStart() { function initGL(canvas) { var canvas = document.getElementById("code00- try { canvas"); gl = canvas.getContext("experimental-webgl"); initGL(canvas); gl.viewportWidth = canvas.width; gl.clearColor(1.0, 1.0, 0.0, 1.0); // yellow gl.viewportHeight = canvas.height; drawScene(); } catch (e) { } } if (!gl) { alert("Could not initialise WebGL, sorry :-("); } viewport } function drawScene() { gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); } Simple OpenGL commands n HTML will call webGLStart(); n canvas is an HTML5 element for drawing n You need a OpenGL context from the canvas for storing internal states n canvas.getContext(); n All OpenGL commands in WebGL start with ‘gl.’ n gl.viewport(); specify the display area n gl.clearColor(); specify the background color n gl.clear(); clear the foreground and background Output Example 1 n Now let’s draw something (two triangles) on the canvas n You will need to provide vertex and fragment shaders n Github: https://github.com/imindseye/WebGL- tutorial simple-triangles.html <!DOCTYPE html> <html> <head> <title>hwshen WebGL &mdash; code01 </title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <!-- ************** Fragment Shader ************* --> Fragment <script id="shader-fs" type="x-shader/x-fragment"> Shader void main(void) { gl_FragColor = vec4(1.0, 0, 0, 1.0); } </script> Vertex <!-- ************** Vertex Shader ************* --> Shader <script id="shader-vs" type="x-shader/x-vertex"> attribute vec3 aVertexPosition; void main(void) { gl_Position = vec4(aVertexPosition, 1.0); } </script> simple-triangles.html (cont’d) <script type="text/javascript" src="shaders_setup.js"></script> <script type="text/javascript" src="code01.js"></script> </head> <body onload="webGLStart();”> <canvas id="code00-canvas" style="border: none;" width="700" height="500"></canvas> <br/> </body> </html> simple-triangles.js var gl; function initGL(canvas) { function webGLStart() { // same as before …. var canvas = document.getElementById("code00- canvas"); … initGL(canvas); } initShaders(); function initShaderers() { initBuffers(); // setup shaders gl.clearColor(1.0, 1.0, 0.0, 1.0); // yellow // load the source, compile and link the code drawScene(); // in shaders_setup.js } } function initBuffers() { // set up vertex buffer objects for geometry // I will explain next … function drawScene() } gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); gl.bindBuffer(gl.ARRAY_BUFFER, squareVertexPositionBuffer); gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, squareVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0); gl.drawArrays(gl.TRIANGLE_STRIP, 0, squareVertexPositionBuffer.numItems); } Output simple-triangles.js n In order to fully understand open-canvas.js, we need to explain n Vertex Buffer Objects – this is how you define your geometry n Shader setup and simple GLSL concepts n How to draw the scene n Below I will start with Shaders setup and then Vertex Buffer Objects (VBO) OpenGL Shading Language (GLSL) n A C-like language and incorporated into OpenGL 2.0 and on n Used to write vertex program and fragment program n No distinction in the syntax between a vertex program and a fragment program n Platform independent Setup of Shader Prgorams n A shader is defined as an array of strings n Steps to set up shaders 1. Create a shader program 2. Create shader objects (vertex and fragment) 3. Send source code to the shader objects 4. Compile the shader 1. Create program object by linking compiled shaders together 2. Use the linked program object shaders_setup.js function initShaders() { shaderProgram = gl.createProgram(); // create a shader program var fragmentShader = getShader(gl, "shader-fs"); // create and compile a vertex shader object var vertexShader = getShader(gl, "shader-vs"); // create and compile a fragment shader object gl.attachShader(shaderProgram, vertexShader); // attach the vertex shader to the shader program gl.attachShader(shaderProgram, fragmentShader); // attach the fragment shader gl.linkProgram(shaderProgram); // link the vertex and fragment shaders if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { alert("Could not initialise shaders"); } gl.useProgram(shaderProgram); // use the shader program } shaders_setup.js function getShader(gl, id) { var shaderScript = document.getElementById(id); if (!shaderScript) { return null; } var str = ""; var shader; var k = shaderScript.firstChild; while (k) { if (shaderScript.type == "x-shader/x-fragment") { if (k.nodeType == 3) { shader = gl.createShader(gl.FRAGMENT_SHADER); str += k.textContent; } else if (shaderScript.type == "x-shader/x-vertex") { } shader = gl.createShader(gl.VERTEX_SHADER); k = k.nextSibling; } else { } return null; } gl.shaderSource(shader, str); gl.compileShader(shader); if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { alert(gl.getShaderInfoLog(shader)); return null; } return shader; } Vertex Buffer Objects n Provide per-vertex input to the GPU n Vertex: a point where the edges of geometry meet n All geometric primitives are composed of vertices, their attributes, and the connectivity n Allow significant increases in vertex throughput between CPU and GPU n The mechanism to provide generic attributes to the shader, and store vertex data in video memory n User’s program is free to define an arbitrary set of per- vertex attributes to the vertex shader Create a VBO n Step 1: generate a new buffer object with gl.createBuffer()
Recommended publications
  • Introduction to the Vulkan Computer Graphics API
    1 Introduction to the Vulkan Computer Graphics API Mike Bailey mjb – July 24, 2020 2 Computer Graphics Introduction to the Vulkan Computer Graphics API Mike Bailey [email protected] SIGGRAPH 2020 Abridged Version This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License http://cs.oregonstate.edu/~mjb/vulkan ABRIDGED.pptx mjb – July 24, 2020 3 Course Goals • Give a sense of how Vulkan is different from OpenGL • Show how to do basic drawing in Vulkan • Leave you with working, documented, understandable sample code http://cs.oregonstate.edu/~mjb/vulkan mjb – July 24, 2020 4 Mike Bailey • Professor of Computer Science, Oregon State University • Has been in computer graphics for over 30 years • Has had over 8,000 students in his university classes • [email protected] Welcome! I’m happy to be here. I hope you are too ! http://cs.oregonstate.edu/~mjb/vulkan mjb – July 24, 2020 5 Sections 13.Swap Chain 1. Introduction 14.Push Constants 2. Sample Code 15.Physical Devices 3. Drawing 16.Logical Devices 4. Shaders and SPIR-V 17.Dynamic State Variables 5. Data Buffers 18.Getting Information Back 6. GLFW 19.Compute Shaders 7. GLM 20.Specialization Constants 8. Instancing 21.Synchronization 9. Graphics Pipeline Data Structure 22.Pipeline Barriers 10.Descriptor Sets 23.Multisampling 11.Textures 24.Multipass 12.Queues and Command Buffers 25.Ray Tracing Section titles that have been greyed-out have not been included in the ABRIDGED noteset, i.e., the one that has been made to fit in SIGGRAPH’s reduced time slot.
    [Show full text]
  • GLSL 4.50 Spec
    The OpenGL® Shading Language Language Version: 4.50 Document Revision: 7 09-May-2017 Editor: John Kessenich, Google Version 1.1 Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008-2017 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast, or otherwise exploited in any manner without the express prior written permission of Khronos Group. You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be reformatted AS LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group website should be included whenever possible with specification distributions.
    [Show full text]
  • Computer Graphics on Mobile Devices
    Computer Graphics on Mobile Devices Bruno Tunjic∗ Vienna University of Technology Figure 1: Different mobile devices available on the market today. Image courtesy of ASU [ASU 2011]. Abstract 1 Introduction Computer graphics hardware acceleration and rendering techniques Under the term mobile device we understand any device designed have improved significantly in recent years. These improvements for use in mobile context [Marcial 2010]. In other words this term are particularly noticeable in mobile devices that are produced in is used for devices that are battery-powered and therefore physi- great amounts and developed by different manufacturers. New tech- cally movable. This group of devices includes mobile (cellular) nologies are constantly developed and this extends the capabilities phones, personal media players (PMP), personal navigation devices of such devices correspondingly. (PND), personal digital assistants (PDA), smartphones, tablet per- sonal computers, notebooks, digital cameras, hand-held game con- soles and mobile internet devices (MID). Figure 1 shows different In this paper, a review about the existing and new hardware and mobile devices available on the market today. Traditional mobile software, as well as a closer look into some of the most important phones are aimed at making and receiving telephone calls over a revolutionary technologies, is given. Special emphasis is given on radio link. PDAs are personal organizers that later evolved into de- new Application Programming Interfaces (API) and rendering tech- vices with advanced units communication, entertainment and wire- niques that were developed in recent years. A review of limitations less capabilities [Wiggins 2004]. Smartphones can be seen as a that developers have to overcome when bringing graphics to mobile next generation of PDAs since they incorporate all its features but devices is also provided.
    [Show full text]
  • Opencl on the GPU San Jose, CA | September 30, 2009
    OpenCL on the GPU San Jose, CA | September 30, 2009 Neil Trevett and Cyril Zeller, NVIDIA Welcome to the OpenCL Tutorial! • Khronos and industry perspective on OpenCL – Neil Trevett Khronos Group President OpenCL Working Group Chair NVIDIA Vice President Mobile Content • NVIDIA and OpenCL – Cyril Zeller NVIDIA Manager of Compute Developer Technology Khronos and the OpenCL Standard Neil Trevett OpenCL Working Group Chair, Khronos President NVIDIA Vice President Mobile Content Copyright Khronos 2009 Who is the Khronos Group? • Consortium creating open API standards ‘by the industry, for the industry’ – Non-profit founded nine years ago – over 100 members - any company welcome • Enabling software to leverage silicon acceleration – Low-level graphics, media and compute acceleration APIs • Strong commercial focus – Enabling members and the wider industry to grow markets • Commitment to royalty-free standards – Industry makes money through enabled products – not from standards themselves Silicon Community Software Community Copyright Khronos 2009 Apple Over 100 companies creating authoring and acceleration standards Board of Promoters Processor Parallelism CPUs GPUs Multiple cores driving Emerging Increasingly general purpose performance increases Intersection data-parallel computing Improving numerical precision Multi-processor Graphics APIs programming – Heterogeneous and Shading e.g. OpenMP Computing Languages Copyright Khronos 2009 OpenCL Commercial Objectives • Grow the market for parallel computing • Create a foundation layer for a parallel
    [Show full text]
  • History and Evolution of the Android OS
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Springer - Publisher Connector CHAPTER 1 History and Evolution of the Android OS I’m going to destroy Android, because it’s a stolen product. I’m willing to go thermonuclear war on this. —Steve Jobs, Apple Inc. Android, Inc. started with a clear mission by its creators. According to Andy Rubin, one of Android’s founders, Android Inc. was to develop “smarter mobile devices that are more aware of its owner’s location and preferences.” Rubin further stated, “If people are smart, that information starts getting aggregated into consumer products.” The year was 2003 and the location was Palo Alto, California. This was the year Android was born. While Android, Inc. started operations secretly, today the entire world knows about Android. It is no secret that Android is an operating system (OS) for modern day smartphones, tablets, and soon-to-be laptops, but what exactly does that mean? What did Android used to look like? How has it gotten where it is today? All of these questions and more will be answered in this brief chapter. Origins Android first appeared on the technology radar in 2005 when Google, the multibillion- dollar technology company, purchased Android, Inc. At the time, not much was known about Android and what Google intended on doing with it. Information was sparse until 2007, when Google announced the world’s first truly open platform for mobile devices. The First Distribution of Android On November 5, 2007, a press release from the Open Handset Alliance set the stage for the future of the Android platform.
    [Show full text]
  • 414 Advances in Opengl ES for Ios 5 V3 DD F
    Advances in OpenGL ES for iOS 5 Session 414 Gokhan Avkarogullari Eric Sunalp iPhone GPU Software These are confidential sessions—please refrain from streaming, blogging, or taking pictures 1 iPad 2 2 3 Per Pixel Lighting/ Normal Maps 4 LightMaps GlossMaps SpecularMaps 5 Dynamic Shadows 6 MSAA 7 Higher Poly Models 8 GLKit New Features 9 GLKit New Features 10 OpenGL ES 2.0 Molecules.app OpenGL ES 1.1 OpenGL ES 2.0 11 GLKit Goals • Making life easier for the developers ■ Find common problems ■ Make solutions available • Encourage unique look ■ Fixed-function pipeline games look similar ■ Shaders to rescue ■ How about porting 12 GLKit GLKTextureLoader GLKTextureLoader • Give a reference—get an OpenGL Texture Object • No need to deal ImageIO, CGImage, libjpg, libpng… 13 GLKit GLKView and GLKViewController GLKTextureLoader GLKView/ViewController • First-class citizen of UIKit hierarchy • Encapsulates FBOs, display links, MSAA management… 14 GLKit GLKMath GLKTextureLoader GLKView/ViewController GLKMath • 3D Graphics math library • Matrix stack, transforms, quaternions… 15 GLKit GLKEffects GLKTextureLoader GLKView/ViewController GLKMath GLKEffects • Fixed-function pipeline features implemented in ES 2.0 context 16 GLKTextureLoader 17 GLKTextureLoader Overview • Makes texture loading simple • Supports common image formats ■ PNG, JPEG, TIFF, etc. • Non-premultiplied data stays non-premultiplied • Cubemap texture support • Convenient loading options ■ Force premultiplication ■ Y-flip ■ Mipmap generation 18 GLKTextureLoader Basic usage • Make an EAGLContext
    [Show full text]
  • Webgl™ Optimizations for Mobile
    WebGL™ Optimizations for Mobile Lorenzo Dal Col Senior Software Engineer, ARM 1 Agenda 1. Introduction to WebGL™ on mobile . Rendering Pipeline . Locate the bottleneck 2. Performance analysis and debugging tools for WebGL . Generic optimization tips 3. PlayCanvas experience . WebGL Inspector 4. Use case: PlayCanvas Swooop . ARM® DS-5 Streamline . ARM Mali™ Graphics Debugger 5. Q & A 2 Bring the Power of OpenGL® ES to Mobile Browsers What is WebGL™? Why WebGL? . A cross-platform, royalty free web . It brings plug-in free 3D to the web, standard implemented right into the browser. Low-level 3D graphics API . Major browser vendors are members of . Based on OpenGL® ES 2.0 the WebGL Working Group: . A shader based API using GLSL . Apple (Safari® browser) . Mozilla (Firefox® browser) (OpenGL Shading Language) . Google (Chrome™ browser) . Opera (Opera™ browser) . Some concessions made to JavaScript™ (memory management) 3 Introduction to WebGL™ . How does it fit in a web browser? . You use JavaScript™ to control it. Your JavaScript is embedded in HTML5 and uses its Canvas element to draw on. What do you need to start creating graphics? . Obtain WebGLrenderingContext object for a given HTMLCanvasElement. It creates a drawing buffer into which the API calls are rendered. For example: var canvas = document.getElementById('canvas1'); var gl = canvas.getContext('webgl'); canvas.width = newWidth; canvas.height = newHeight; gl.viewport(0, 0, canvas.width, canvas.height); 4 WebGL™ Stack What is happening when a WebGL page is loaded . User enters URL . HTTP stack requests the HTML page Browser . Additional requests will be necessary to get Space User JavaScript™ code and other resources WebKit JavaScript Engine .
    [Show full text]
  • Rowpro Graphics Tester Instructions
    RowPro Graphics Tester Instructions What is the RowPro Graphics Tester? The RowPro Graphics Tester is a handy utility to quickly check and confirm RowPro 3D graphics and live water will run in your PC. Do I need to test my PC graphics? If any of the following are true you should test your PC graphics before installing or upgrading to RowPro 3: If your PC shipped new with Windows XP. If you are about to upgrade from RowPro version 2. If you have any doubts or concerns about your PC graphics system. How to download and install the RowPro Graphics Tester Click the link above to download the tester file RowProGraphicsTest.exe. In the download dialog box that appears, click Save or Save this program to disk, navigate to the folder where you want to save the download, and click OK to start the download. IMPORTANT NOTE: The RowPro Graphics Tester only tests if your PC has the required graphics components installed, it is not a graphics performance test. Passing the RowPro Graphics Test is not a guarantee that your PC will run RowPro at a frame rate that is fast enough to be useful. It is however an important test to confirm your PC is at least equipped with the necessary graphics components. How to run the RowPro Graphics Tester 1. Run RowProGraphicsTest.exe to run the test. The test normally completes in less than a second. 2. If any of the results show 'No', check the solutions below. 3. Click the x at the top right of the test panel to close the test.
    [Show full text]
  • Opengl Shading Languag 2Nd Edition (Orange Book)
    OpenGL® Shading Language, Second Edition By Randi J. Rost ............................................... Publisher: Addison Wesley Professional Pub Date: January 25, 2006 Print ISBN-10: 0-321-33489-2 Print ISBN-13: 978-0-321-33489-3 Pages: 800 Table of Contents | Index "As the 'Red Book' is known to be the gold standard for OpenGL, the 'Orange Book' is considered to be the gold standard for the OpenGL Shading Language. With Randi's extensive knowledge of OpenGL and GLSL, you can be assured you will be learning from a graphics industry veteran. Within the pages of the second edition you can find topics from beginning shader development to advanced topics such as the spherical harmonic lighting model and more." David Tommeraasen, CEO/Programmer, Plasma Software "This will be the definitive guide for OpenGL shaders; no other book goes into this detail. Rost has done an excellent job at setting the stage for shader development, what the purpose is, how to do it, and how it all fits together. The book includes great examples and details, and good additional coverage of 2.0 changes!" Jeffery Galinovsky, Director of Emerging Market Platform Development, Intel Corporation "The coverage in this new edition of the book is pitched just right to help many new shader- writers get started, but with enough deep information for the 'old hands.'" Marc Olano, Assistant Professor, University of Maryland "This is a really great book on GLSLwell written and organized, very accessible, and with good real-world examples and sample code. The topics flow naturally and easily, explanatory code fragments are inserted in very logical places to illustrate concepts, and all in all, this book makes an excellent tutorial as well as a reference." John Carey, Chief Technology Officer, C.O.R.E.
    [Show full text]
  • Migrating from Opengl to Vulkan Mark Kilgard, January 19, 2016 About the Speaker Who Is This Guy?
    Migrating from OpenGL to Vulkan Mark Kilgard, January 19, 2016 About the Speaker Who is this guy? Mark Kilgard Principal Graphics Software Engineer in Austin, Texas Long-time OpenGL driver developer at NVIDIA Author and implementer of many OpenGL extensions Collaborated on the development of Cg First commercial GPU shading language Recently working on GPU-accelerated vector graphics (Yes, and wrote GLUT in ages past) 2 Motivation for Talk Coming from OpenGL, Preparing for Vulkan What kinds of apps benefit from Vulkan? How to prepare your OpenGL code base to transition to Vulkan How various common OpenGL usage scenarios are re-thought in Vulkan Re-thinking your application structure for Vulkan 3 Analogy Different Valid Approaches 4 Analogy Fixed-function OpenGL Pre-assembled toy car fun out of the box, not much room for customization 5 AZDO = Approaching Zero Driver Overhead Analogy Modern AZDO OpenGL with Programmable Shaders LEGO Kit you build it yourself, comes with plenty of useful, pre-shaped pieces 6 Analogy Vulkan Pine Wood Derby Kit you build it yourself to race from raw materials power tools used to assemble, adult supervision highly recommended 7 Analogy Different Valid Approaches Fixed-function OpenGL Modern AZDO OpenGL with Vulkan Programmable Shaders 8 Beneficial Vulkan Scenarios Has Parallelizable CPU-bound Graphics Work yes Can your graphics Is your graphics work start work creation be CPU bound? parallelized? yes Vulkan friendly 9 Beneficial Vulkan Scenarios Maximizing a Graphics Platform Budget You’ll yes do whatever Your graphics start it takes to squeeze platform is fixed out max perf. yes Vulkan friendly 10 Beneficial Vulkan Scenarios Managing Predictable Performance, Free of Hitching You put yes You can a premium on manage your start avoiding graphics resource hitches allocations yes Vulkan friendly 11 Unlikely to Benefit Scenarios to Reconsider Coding to Vulkan 1.
    [Show full text]
  • Opengl 4.0 Shading Language Cookbook
    OpenGL 4.0 Shading Language Cookbook Over 60 highly focused, practical recipes to maximize your use of the OpenGL Shading Language David Wolff BIRMINGHAM - MUMBAI OpenGL 4.0 Shading Language Cookbook Copyright © 2011 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: July 2011 Production Reference: 1180711 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849514-76-7 www.packtpub.com Cover Image by Fillipo ([email protected]) Credits Author Project Coordinator David Wolff Srimoyee Ghoshal Reviewers Proofreader Martin Christen Bernadette Watkins Nicolas Delalondre Indexer Markus Pabst Hemangini Bari Brandon Whitley Graphics Acquisition Editor Nilesh Mohite Usha Iyer Valentina J. D’silva Development Editor Production Coordinators Chris Rodrigues Kruthika Bangera Technical Editors Adline Swetha Jesuthas Kavita Iyer Cover Work Azharuddin Sheikh Kruthika Bangera Copy Editor Neha Shetty About the Author David Wolff is an associate professor in the Computer Science and Computer Engineering Department at Pacific Lutheran University (PLU).
    [Show full text]
  • Webgl: the Standard, the Practice and the Opportunity Web3d Conference August 2012
    WebGL: The Standard, the Practice and the Opportunity Web3D Conference August 2012 © Copyright Khronos Group 2012 | Page 1 Agenda and Speakers • 3D on the Web and the Khronos Ecosystem - Neil Trevett, NVIDIA and Khronos Group President • Hands On With WebGL - Ken Russell, Google and WebGL Working Group Chair © Copyright Khronos Group 2012 | Page 2 Khronos Connects Software to Silicon • Khronos APIs define processor acceleration capabilities - Graphics, video, audio, compute, vision and sensor processing APIs developed today define the functionality of platforms and devices tomorrow © Copyright Khronos Group 2012 | Page 3 APIs BY the Industry FOR the Industry • Khronos standards have strong industry momentum - 100s of man years invested by industry leading experts - Shipping on billions of devices and multiple operating systems • Khronos is OPEN for any company to join and participate - Standards are truly open – one company, one vote - Solid legal and Intellectual Property framework for industry cooperation - Khronos membership fees to cover expenses • Khronos APIs define core device acceleration functionality - Low-level “Foundation” functionality needed on every platform - Rigorous conformance tests for cross-vendor consistency • They are FREE - Members agree to not request royalties Silicon Software © Copyright Khronos Group 2012 | Page 4 Apple Over 100 members – any company worldwide is welcome to join Board of Promoters © Copyright Khronos Group 2012 | Page 5 API Standards Evolution WEB INTEROP, VISION MOBILE AND SENSORS DESKTOP OpenVL New API technology first evolves on high- Mobile is the new platform for Apps embrace mobility’s end platforms apps innovation. Mobile unique strengths and need Diverse platforms – mobile, TV, APIs unlock hardware and complex, interoperating APIs embedded – mean HTML5 will conserve battery life with rich sensory inputs become increasingly important e.g.
    [Show full text]