Computer Graphics Ben-Gurion University of the Negev Fall 2012.

Slides:



Advertisements
Similar presentations
Chapter 11. Faster Geometry Throughput Presented by Garrett Yeh.
Advertisements

1Computer Graphics Building Models John Shearer Culture Lab – space 2
Vertex Buffer Objects, Vertex Array Objects, Pixel Buffer Objects.
©Zachary Wartell, UNCC9/28/ :30 AM 1 Overview of OpenGL Revision: 1.2 Copyright Professor Zachary Wartell, University of North Carolina All Rights.
EECS 700: Computer Modeling, Simulation, and Visualization Dr. Shontz Chapter 2: Shader Fundamentals (continued)
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Building Models modified by Ray Wisman Ed Angel Professor of Computer Science,
1 Building Models. 2 Objectives Introduce simple data structures for building polygonal models ­Vertex lists ­Edge lists OpenGL vertex arrays.
Graphics Pipeline.
Status – Week 257 Victor Moya. Summary GPU interface. GPU interface. GPU state. GPU state. API/Driver State. API/Driver State. Driver/CPU Proxy. Driver/CPU.
Computer Graphics(Fall 2003) COMS 4160, Lecture 7: OpenGL 3 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
OPENGL Return of the Survival Guide. Buffers (0,0) OpenGL holds the buffers in a coordinate system such that the origin is the lower left corner.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
 The success of GL lead to OpenGL (1992), a platform-independent API that was  Easy to use  Close enough to the hardware to get excellent performance.
As well as colors, normals, and other vertex data PUSHIN’ GEO TO THE GPU JEFF CHASTINE 1.
OpenGL Son of the Survival Guide. Last Time on OpenGL Windowing … glut Rendering Primatives Transformations Projections State Management.
Meshes Dr. Scott Schaefer. 3D Surfaces Vertex Table.
OpenGL Display Lists A way to improve performance.
1 Lecture 12 Texture Mapping uploading of the texture to the video memory the application of the texture onto geometry.
Buffer Objects Kurt Akeley, NVIDIA Corporation. Outline Background Buffer Objects Vertex Arrays Examples.
OpenGL Pixel Operations, Bitmaps, Fonts and Images The Current Raster Position Current raster position: A position in window coordinates where the next.
OpenGL. Textures  Bind Textures similar to binding VBO’s  Create a texture for each object  Generate the texture similar how you generate a VBO buffer.
Picking. What is picking? Selecting an object on the screen What does this require? –Get Mouse Location –Compute what objects are rendered at the position.
 Bitmap: A bitmap is a rectangular array of 0s and 1s that serves as a drawing mask for a corresponding rectangular portion of the window.  Applications:
Speeding Up Rendering After Deciding What to Draw.
Korea University Korea University Computer Graphics Laboratory Computer Graphics Laboratory Jung Lee, Chapter 13.
Interactive Computer Graphics CS 418 – Spring 2015 Mesh Rendering, Transformation, Camera Viewing and Projection in OpenGL TA: Zhicheng Yan Sushma S Kini.
State Management and Drawing Geometry Objects
OpenGL Buffer Transfers Patrick Cozzi University of Pennsylvania CIS Spring 2012.
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Review of OpenGL Basics
111/17/ :24 UML Solution Involves Selection of Discrete Representation Values.
Computer Graphics Bing-Yu Chen National Taiwan University.
OpenGL Shader Language Vertex and Fragment Shading Programs.
MAE152 Computer Graphics for Scientists and Engineers Fall 03 Display Lists.
1 3D API OPENGL ES v1.0 Owned by Silicon Graphics (SGL) Control was then transferred to Khronos Group Introduction.
CH8 Frame Buffer Object 1. Introduction Name OpenGL :Frame Buffer Object DirectX:Render Target Usage Render to Texture 2.
OpenGL Architecture Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Frame Buffer Texture.
Wilf Comp Shaders. Wilf Comp 4002 Shaders Shaders are programs that you can download onto the card Can be used.
UniS CS297 Graphics with Java and OpenGL State Management and Drawing Primative Geometric Objects.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
OpenGL Programming Guide : Texture Mapping Yoo jin wook Korea Univ. Computer Graphics Lab.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Details of Texture Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 1, 2003.
OpenGL Vertex Arrays OpenGL vertex arrays store vertex properties such as coordinates, normal vectors, color values and texture coordinates. These properties.
Computer Graphics I, Fall 2010 Building Models.
11/16/04© University of Wisconsin, CS559 Fall 2004 Last Time Texture Anti-Aliasing Texture boundaries Modeling introduction.
A study of efficiency INDEX BUFFERS JEFF CHASTINE 1.
11/12/02(c) University of Wisconsin, CS559 Last Time Texturing Details Homework 5.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
4. Geometric Objects and Transformations
Texture Mapping CEng 477 Introduction to Computer Graphics.
CS 480/680 Computer Graphics Programming with Open GL Part 2: Complete Programs Dr. Frederick C Harris, Jr. Fall 2011.
Pushin’ Geo to the GPU As well as colors, normals, and other vertex data Made by Jeff Chastine, Modified by Chao Mei Jeff Chastine.
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Draw a Simple Object.
Real-Time Rendering Buffers in OpenGL 3.3
Building Models Ed Angel
Geb Thomas Adapted from the OpenGL Programming Guide
Class 26 more textures environmental textures Color ramps
Isaac Gang University of Mary Hardin-Baylor
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Computer Graphics Practical Lesson 8
Programming with OpenGL Part 2: Complete Programs
Programming with OpenGL Part 2: Complete Programs
Geometric Objects and Transformations (I)
Mickaël Sereno Shaders Mickaël Sereno 25/04/2019 Mickaël Sereno -
Class 27 more textures environmental textures Color ramps
Mickaël Sereno Graphics Memory Mickaël Sereno 11/07/2019 Mickaël Sereno -
Computer Graphics Vertex Array Object
Presentation transcript:

Computer Graphics Ben-Gurion University of the Negev Fall 2012

 Display Lists  Vertex Arrays  Vertex Buffer Objects 2

 Group of OpenGL commands that have been compiled for later execution  Vertex and pixel data are evaluated and copied into the display list memory  You can reuse it repeatedly without re-evaluating and re- transmitting data  It reduces CPU cycles to perform the actual data transfer  Expensive computations (transformation, lighting …) are processed only once while display list is created Static or Dynammic ? 3

 Drawing a cube consists of:  Drawing 6 Quads – Faces  Each face needs 4 glVertex*() calls  24 glVertex*() calss in total  What about glColor* ( 24 ) and glNormals*( 24 ) ?  We can notice that vertices are shared among faces 4

 Using vertex array reduces the number of function calls  It also reduces the redundant usage of shared vertices 5 arrays are transferred to the video adapter every frame drawing

 OpenGL provides functions to activate and deactivate 6 different types of arrays glEnableClientState(), glDisableClientState()  There are 6 functions to specify the exact positions of arrays  glVertexPointer(): specify pointer to vertex coords array  glNormalPointer(): specify pointer to normal array  glColorPointer(): specify pointer to RGB color array  glTexCoordPointer(): specify pointer to texture cords array 6

glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)  size: specifies the number of coordinates per vertex. Default is 4.  type: GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE are accepted  stride: specifies the byte offset between consecutive vertices  pointer: specifies a pointer to the first coordinate of the first vertex in the array. 7

 Enhances the performance of OpenGL  providing the benefits of vertex array and display list while avoiding their downsides  Allows vertex array data to be stored in graphics memory  Vertex buffer objects can be modified after its creation 8

 Creating a VBO requires 3 steps:  Generate a new buffer object with glGenBuffersARB().  Bind the buffer object with glBindBufferARB().  Copy vertex data to the buffer object with glBufferDataARB(). 9

 Requires 2 parameters:  the first one is the number of buffer objects to create  the second parameter is the address of a GLuint variable or array to store a single ID or multiple IDs glGenBuffersARB(GLsizei n, GLuint* ids) 10

 Hooks the buffer object with the corresponding ID glBindBufferARB(GLenum target, GLuint id)  Target is a hint to tell VBO whether this buffer object will store vertex array data or index array data  GL_ARRAY_BUFFER_ARB (vertex array)  Vertex coordinates  Texture coordinates  Normals  and more  GL_ELEMENT_ARRAY_BUFFER_ARB (index array) 11

glBufferDataARB(GLenum target, GLsizei size, const void* data, GLenum usage)  target: GL_ARRAY_BUFFER_ARB/ GL_ELEMENT_ARRAY_BUFFER_ARB  size: number of bytes of data to transfer  data: pointer to the source data  Usage: provide how the buffer object is going to be used  GL_STATIC_DRAW_ARB  GL_DYNAMIC_DRAW_ARB 12

13

14 Switch VBO off