120 likes | 293 Views
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources. CSCI 6360/4360. Overview. Putting the OpenGL pieces together Recall, this all a “survival guide” … OpenGL “post-view” Coordinate systems in viewing OpenGL Transformations Transformations between coordinate systems
E N D
OpenGL ConclusionsOpenGL Programming and Reference Guides, other sources CSCI 6360/4360
Overview • Putting the OpenGL pieces together • Recall, this all a “survival guide” … • OpenGL “post-view” • Coordinate systems in viewing • OpenGL Transformations • Transformations between coordinate systems • OpenGL geometry and pixel paths • OpenGL pipeline • Vertices primitives fragments pixels • Programmer access to all • Pieces in context of the whole
Coordinate Systems in Viewing • Coordinate Systems in the Graphics Pipeline • OCS – object coordinate system • WCS – world coordinate system • VCS – viewing coordinate system • CCS – clipping coordinate system • NDCS - normalized device coordinate system • DCS – device coordinate system • Images are formed on the image plane
OpenGL Transformations • Series of “viewing transformations” • transforms a point (its coordinates) from world space to eye space • Set these transformation matrices as part of OpenGL programming • Each transformation operates on different spaces and coordinates • Model – View – Projection – Perspective Divide - Viewport • From “red book”:
Transform. between Coordinate Sys. • Transformations • Between coordinate systems • Model • OCS – WCS • View • WCS – V(E)CS • Projection • VCS – CCS • Perspective divide • CCS - NDCS • Viewport • NDCS - DCS
Many techniques rely on direct interactions with frame buffer Texture mapping, antialiasing, compositing, alpha blending, … OpenGL allows API access to both “geometry path” and “pixel path” Bitmaps, pixel to rasterization and texture mapping to fragment processing Images and geometry flow through separate pipelines that join during rasterization and fragment processing “complex” textures do not affect geometric complexity Texture application is done “at last minute” Texture Mapping and OpenGL Pipeline Geometry Path Geometry Path Pixel Path
OpenGL Pipeline • OpenGL pipeline “big picture” • Different coordinate systems • Transformations • Figure from Blue Book • http://www.opengl.org/documentation/blue_book • http://www.glprogramming.com/blue/ch02.html • Vertices – describe shape of objects • Primitives – polygons, lines, pixels • Fragments – clipped, etc., primitives • Pixels – elements of frame buffer • Three parallel set of operations on • Vertices, color, textures
OpenGL Pipeline - Vertices • Vertices • Location (x,y,z) and color (rgba) • Normal used for lighting, etc. • Vertex position transformed by model-view matrix • Object loc. and camera view • Lighting model applied to vertex color (using vertex loc.) • Textures • Recall, different (sub)pipeline • OpenGL handles the mapping of textures to polygons • Texture coordinates • Vertex raster position • Where in frame buffer located
OpenGL Pipeline - Primitives • Primitive Assembly • Assembly of verts. into primitives • Polygons, line segments, points • Conversion to pixel fragments • Clipped • Converted to wind. coords. • App. Clipping of primitives • Projection transformation • Clip to view volume • Transform to clip coordinates • Perspective divide • to normalized device coordinates • Map to viewport and window • Direct pixel operations possible
OpenGL Pipeline-Fragments, Pixels • Fragment • Point and its color, texture, depth data are a fragment • Rasterization • Converts clipped primitives to 2-d image (pixels) • Each point of image contains color, texture, depth data • Fragments operations (e.g., xor) can be performed • Final texture application using “images” stored in memory based on fragment values • Frame buffer • Image scanned out
OpenGL Pipeline • … and that’s the “big picture!