Using OpenGL Functionality: New Features, History, and Techniques, Study notes of Computer Science

An overview of using new opengl functionality, including the need for wglgetprocaddress() and libraries like glew and glee. It also covers the history of opengl, from its origins in the late 1980s to the present, and discusses various topics such as particle systems, point sprites, vertex buffer objects, and more. Students and researchers in computer graphics, computer science, and related fields will find this information useful for understanding the evolution and capabilities of opengl.

Typology: Study notes

Pre 2010

Uploaded on 07/30/2009

koofers-user-d0e
koofers-user-d0e ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 47

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Using new OpenGL functionality
โ—Get latest drivers for your videocard
โ—(www.nvidia.com or ati.amd.com)
โ—Get the latest glext.h
โ—(http://www.opengl.org/registry/api/glext.h)
โ—At run time use wglGetProcAddress()
void* wglLoadExtension(char* name)
{
void* result = wglGetProcAddress(name);
if(!result)
{
printf("Extension %s could not be loaded.\n", name);
}
return result;
}
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f

Partial preview of the text

Download Using OpenGL Functionality: New Features, History, and Techniques and more Study notes Computer Science in PDF only on Docsity!

Using new OpenGL functionality

โ— Get latest drivers for your videocard โ— (^) (www.nvidia.com or ati.amd.com) โ— Get the latest glext.h โ— (^) (http://www.opengl.org/registry/api/glext.h) โ— At run time use wglGetProcAddress() void* wglLoadExtension(char* name) { void* result = wglGetProcAddress(name); if(!result) { printf("Extension %s could not be loaded.\n", name); } return result; }

Using new OpenGL functionality

โ— You need wglGetProcAddress for all new functions declared after OpenGL 1. โ— Other libraries can handle this for you โ— (^) GLEW (OpenGL Extension Wrangler) โ— GLEE (OpenGL Easy Extension Library)

History of OpenGL

โ— (^) Late 1980s : Silicon Graphics IrisGL - SGI hardware dependent โ— (^) 1992 : OpenGL 1.0 - Open standard โ— (^) Standard is governed by the OpenGL ARB (architecture review board) : โ— (^) Microsoft, SUN, SGI, nVidia, ATI, etc. โ— (^) 1997 : OpenGL 1.1 - texture objects and vertex arrays. โ— (^) 1998 : OpenGL 1.2 - 3d textures, new blending equations โ— (^) 2001 : OpenGL 1.3 - cube maps, multitexturing โ— (^) 2002 : OpenGL 1.4 - Automatic mipmap generation, depth textures โ— (^) 2003 : OpenGL ES - embedded systems โ— (^) 2003 : OpenGL 1.5 - vertex and fragment programs, occlusion query โ— (^) 2004 : OpenGL 2.0 - GL shading language, non-power-of-2 textures, point sprites โ— (^) August 2006 : OpenGL 2.1 - GLSL changes. โ— (^) Fall 2006 โ€“ the Khronos group becomes the governing body for OpenGL โ— (^) 2006 Plans for OpenGL 3.0 (codename โ€œLong Peaksโ€) and OpenGL 4.0 (codename โ€œMt. Evansโ€) announced โ— (^) 2008 : OpenGL 3.0 specification finalized

Khronos Group Members

New features and extensions we will look at

โ— OpenGL 1.3 : Cube Map Textures,Multisample Antialiasing โ— OpenGL 1.4 : Automatic Mipmap generation, Depth Textures โ— OpenGL 1.5 : Vertex Buffer Objects, Occlusion Query โ— OpenGL 2.0 : Programmable Shading (GLSL), Multiple Render Targets, NPOT textures, Point Sprites โ— OpenGL 2.1 : Pixel Buffer Objects โ— EXT : Frame Buffer Objects, Anisotropic texture filtering, Floating point textures

Topics

โ— Particle Systems โ— (^) Point Sprites โ— Vertex Buffer Object โ— Environment Mapping (reflections) โ— (^) Cube mapping โ— Frame buffer object โ— Mesh Rendering โ— Occlusion Query โ— MSAA

Billboard Applications

โ— Lens flares, blooms โ— Imposters โ— Particle Systems

Radially Symmetric

โ— If r, u are the camera right and up vector โ— p is particle position (center) โ— h is half height of particle p+ h (r+u) r u p- h (r+u) p+ h (u-r) p+ h (r-u)

Axially symmetric

โ— Constrained to rotate about an axis โ— (^) Fixed Up vector โ— Determine right vector using cross product โ— (^) Right = Up x look

Particle Systems

โ— (^) Star Trek 2 โ— (^1983) William Reeves Particle Systems

Vector Field Visualization

Given vector field v(x,y,z) update particle positions by Or a higher order integration scheme (RK4) See page 560-562 in book. p i ๎‚ƒ 1 = p i ๎‚ƒ v i ๎‚ญ t

Tensor Field Visualization

โ— Rank 2 tensor can be represented as a matrix โ— Use this matrix to generate a texture matrix Particles rendered with various texture matrices and wrap modes

Particle Rendering

โ— Alpha Blending glEnable(GL_BLEND) โ— (^) Semitransparent (Smoke, Water, Fog) โ— (^) glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); โ— Additive (Fire, Sparks) โ— (^) glBlendFunc(GL_SRC_ALPHA, GL_ONE); โ— Depth โ— (^) Sort back-to-front โ— (^) Expensive for systems with many particles โ— Disable Z buffer writes โ— (^) glDepthMask(GL_FALSE)

Rendering Transparent Objects

โ— Render fully opaque objects first โ— Render semitransparent objects (alpha < 1) glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); Back-to-front rendering Front-to-back rendering โ— Disabling Z-buffer writes will help, but results won't always be correct