Introduction to accelerated graphics
-
Upload
ruslan-novikov -
Category
Software
-
view
130 -
download
1
description
Transcript of Introduction to accelerated graphics
![Page 2: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/2.jpg)
IRIS GL
1992
![Page 3: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/3.jpg)
1996 3Dfx creates Voodoo Graphics
First successful consumer 3D accelerator
1997 id Software releases Quake II game
This game uses Open GL out of the box
1999 Nvidia releases GeForce 256
first consumer-level PC graphics chip with hardware transform, lighting, and shading
![Page 4: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/4.jpg)
What is OpenGL?
OpenGL stands for Open Graphics Library. It is a specification of an API for rendering 3D graphics
What is NOT OpenGL?
The OpenGL API only deals with rendering graphics. OpenGL does not provide functions for animations, timing, image file format processing, GUI etc.
Is OpenGL Open Source?
No, OpenGL doesn't have any source code. GL is a specification
![Page 5: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/5.jpg)
![Page 6: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/6.jpg)
Change Machine State glEnable(); glDisable(); glMatrixMode(); glBindFramebufferOES();
glViewport(); glVertexPointer(); glColorPointer(); glTranslatef() ...
Issue Drawing Commands glDrawArrays(); glDrawElements(); ...
Read Back State, Drawing Results glGetBooleanv(); glGetFloatv(); glReadPixels(); ...
![Page 7: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/7.jpg)
Window Coordinates Normalized Device Coordinates Clip and Eye Coordinates World Coordinates Object Coordinates
![Page 8: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/8.jpg)
![Page 9: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/9.jpg)
![Page 10: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/10.jpg)
![Page 11: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/11.jpg)
![Page 12: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/12.jpg)
![Page 13: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/13.jpg)
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glOrthof(left, right, bottom, top, zNear, zFar); glFrustumf(left, right, bottom, top, zNear, zFar); glRotatef(degrees, x, y, z); glTranslatef(x, y, z); glScalef(x, y, z); glMultMatrixf(matrix); glPushMatrix(); glPopMatrix();
![Page 14: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/14.jpg)
OpenGL ES draws triangles, lines, and points Object space vertices mapped into window
space Rasterize the shapes to get pixels
![Page 15: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/15.jpg)
Each vertex can have a color associated RGBA
Alpha usually means opacity
Lines and triangles interpolate colors
![Page 16: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/16.jpg)
Vertices are passed to OpenGL ES in arrays Drawing modes determine how vertices are
interpreted to produce shapes Vertex order matters
![Page 17: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/17.jpg)
Use a triangle strip
![Page 18: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/18.jpg)
![Page 19: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/19.jpg)
Color pixels according to an image in memory Almost always 2D Vertices are given texture coordinates (u,v)
u
v
![Page 20: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/20.jpg)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture.name); GLFloat textureCoordArray[] = { u1,v1, u2,v2, u3,v3, ... }; glTexCoordPointer(2, GL_FLOAT, arrayOffset, textureCoordArray); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glDrawArrays(GL_TRIANGLE_STRIP, arrayOffset, numberOfVertices); glDisableClientState(GL_TEXTURE_COORD_ARRAY);
![Page 21: Introduction to accelerated graphics](https://reader030.fdocuments.in/reader030/viewer/2022020207/54b4d8504a79597d318b4717/html5/thumbnails/21.jpg)
https://www.youtube.com/watch?v=_WcMe4Yj0NM
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/node/79