Real-Time Rendering
Total Page:16
File Type:pdf, Size:1020Kb
y Course Overview y History of OpenGL y Understanding the back‐ward capabilities and some of the ugliness in the current specification. y History of Shading Languages y History of GhiGraphics HdHardware y Understand where we came from and why some of the literature / web sources may no longer be valid. Roger Crawfis y Appreciate modern Stream‐based Architectures. The Ohio State University y Review of OpenGL and basic Computer Graphics y The OpenGL 101.0 pipeline and the OpenGL 303.0 pipeline y The OpenGL Shading Language – GLSL y Simple model viewer application (lab 1) y Implementing a Trackball interface y Review and Midterm y Frame Buffer Objects y The GPU vs. the CPU y Multi‐texturing and a 3D Paint application (lab2) y Performance trends y Environment Mapping y Virtual Machine Architecture (DirectX 10) y Normal and Displacement Mapping y Specific Hardware Implementations y Lab3. y ATI Radeon 9700 y nVidia timeline and the G80 architecture. y XBox 360. y Future Trends y Mixed cores y Intel’s Larrabee y Lab 3 specification (multiple render targets and y Final Project specifications geometry shaders) y Aliasing y Hierarchical z‐buffer and z‐culling y Fourier Theory y Shadow algorithms y Full‐screen anti‐aliasing y Planar shdhadows y Texture filtering and sampling y Ambient occlusion y Shadow map filtering y Shadow volumes y Shadow maps y Aliasing and precision issues y OpenGL in a multi‐threading context y Non‐photorealistic rendering y High‐performance rendering y Volume rendering y Frustum culling y Special topics y Clip‐mapping y Animation and Skinning y Prerequisites y CSE 581 or knowledge of OpenGL and basic computer y Real‐Time Rendering by graphics (linear alblgebra, coordina te systems, lig ht Tomas Akenine‐Moller, models). Eric Haines and Naty rd y Good ppgrogramming skills (()C/C++/C#) Hoffman (3 edition) y Interested in Computer Graphics: y Love graphics and want to learn more y Be willing to learn things by yourself and try out cool stuff z OpenGL Shading z Advanced Graphics Language by Randi J. Programming Using Rost, Addison‐Wesley OpenGL by Tom McReynolds and David z The Orange Book Blythe (Publisher: Morgan Kaufmann/Elsevier) y Three labs and one final project: 50% y Three individual labs y 3D Games I/II by Alan y SllSmall team project (d(grad versus undd)dergrad) Watt and Fabio y Midterm exam: 20% Policarpo, Addison‐ Wesley y Fina l exam: 20% y Misc 10% y OpenGL Programming GidGuide (Open GL 2.0), y homework or quiz Addison‐Wesley y class attendance y SIGGRAPH Tutorials and papers y Advanced real time rendering algorithms (GPU‐based) y Graphics rendering y We will use OpenGL as the API –you need to know pipeline Application how to program OpenGL (if not, you need to learn by y Geometry processing yourself) y Rasterization Geometry Rasterizer Image y Programmable Shaders y Visibility and occlusion y Advanced texture culling techniques mapping algorithms y Selected advanced topics y Perspective correction y Level of detail y Bump mapping y Non‐photorealistic y Environment mapping rendering y Volume rendering y Anti‐aliasing y Skinn ing and AiAnimat ion y Geometry y Textures y Shadow algorithms y All labs are to be done on Microsoft Windows machines y Pre‐1992 using Visual Studio 2008 in C++ or C#. y 2D Graphics –GTK y 3D – IRIS GL, ANSI/ISO PHIGS, PEX y 1992 –OpenGL 1.0 y You will need a DirectX 10 class graphics card (nVidia y PHIGS killer GeFo rce 8800 or better, or ATI Radeon 2400 or better). y Controlled by the ARB (Architecture Review Board) y 1995 –OpenGL 1.1 y Texture Objects y Graphics Lab –CL 112D has several PCs with nVidia y Vertex Arrays 3D Graphics start to flourish GeForce 8800 GTX cards. These machines are reserved for y 1998 –OpenGL 1.2 on the PC at about this time the graphics courses, so kick other students out. y 3D Textures y Imaging Subset y Note: Dr. Parent’s Animation Project course is also this y 1998 –OpenGL 1.2.1 quarter and they need to access to some of the machines y ARB extension mechanism y that have Maya installed. y Multi‐texturing ARB extension y 2000 –OpenGL 1.3 y 2004 –OpenGL 2.0 y Multi‐texturing y Programmable Shaders y Texture Combiners (Yuck!) y Multiple Render Targets y Multi‐sampling y Point Sprites y Compressed textures and cube‐map textures y Non‐Power of Two Textures y 2001 – OpenGL 141.4 y 2006 – OpenGL 212.1 y Depth Textures y Shader Language 1.2 y Point Parameters y sRGB Textures y ViVarious additiona l stttates y 2008 –OpenGL 3.0 y 2003 –OpenGL 1.5 y Deprecation model! y Occlusion Queries y Frame Buffer Objects y Texture comparison modes for shadows y Shader Language 1.3 y Vertex Buffers y Texture Arrays y Programmable Shaders introduced as an ARB extension. y Khronos Group controlled Texture y RenderMan Map Combine y Cg Light vertices into y HLSL triangle, Depth‐test Transform Texture map, Convert to Alpha‐test Final color y GLSL 1.0 Project fragments, Blending IlInterpolate y GLSL 121.2 Vertex Triangle Fragment Raster Frame‐ y Automatic integer to float conversion Shader Setup Shader Operations buffer y Initializers on uniform variables y Centroid interpolation y GLSL 1.3 y Integer support y Texel access (avoid sampler) y Texture arrays y Shade Trees by Robert Cook (SIGGRAPH 1984) y Still heavily used in feature film productions. y Uses a tree structure to determine what operations to y Entire careers focused around shader development. perform. y Really took off with Perlin’s and Peachey’s Noise functions and shading results at SIGGRAPH 1985. [Proudfoot 2001] y Cg was developed by nVidia y OpenGL’s belated entry. y HLSL was developed by Microsoft y We will study this in more depth shortly. y They worked very closely together. As such there is little difference between the two languages. y Difference is in the run‐time. struct VERT_OUTPUT { float4 position: POSITION; float4 color : COLOR; }; VERT_OUTPUT green(float2 position : POSITION) { VERT_OUTPUT OUT; OUT. position = float4(position, 0, 1); OUT.color = float4(0, 1, 0, 1); return OUT; } y There have been many other shading languages, y Early History targeting different capabilities. y Flight‐Simulators –Evans and Sutherland y Sh y CAD – Workstations – SGI, DEC, HP, Apollo y Visualization y Brooks y Stellar (1989?) y CUDA y AdArden t y OpenCL y SGI y Ashli y Entertainment (Hollywood) y Cray y Custom Hardware –Pixar Image Computer y It is important to note, that this early excitement in 3D graphics in the late 1980’s and early 1990’s set the stage for the PC boom. Generation I: 3dfx Voodoo (1996) Generation II: GeForce/Radeon 7500 (1998) •One of the first true 3D game cards • Hardware‐based transformation and lighting (TnL) •Add‐on for a standard 2D video card. calllculations. •Vertex transformations on the CPU •Multi‐texturing support. • Texture mapping and z‐buffering. • AGP bus http://accelenation.com/?ac.id.123.2 •PCI bus becomes the bottleneck •nVidia coins the term GPU, ATI counters with the http://accelenation.com/?ac.id.123.5 term VPU (Visual Processing Unit). • DiDevice didriver becomes a bttlbottlenec k Vertex Primitive Rasterization Fragment Frame Vertex Primitive Rasterization Fragment Frame and Operations and Operations Transforms Assembly Interpolation Buffer Transforms Assembly Interpolation Buffer CPU GPU GPU PCI AGP Generation III: GeForce3/Radeon 8500(2001) Generation IV: Radeon 9700/GeForce FX (2002) • For the first time, allowed limited amount of • Fully-programmable graphics cards programmablbility in t he vertex pipe line • Different resource limits on fragment and vertex • Also allowed volume texturing and multi-sampling programs (for anti-aliasing) http://accelenation.com/?ac.id.123.7 AGP http://accelenation.com/?ac.id.123.8 Vertex Primitive Rasterization Fragment Frame and Rasterization Programmable Transforms Assembly Operations Buffer Vertex Programmable Frame Interpolation and Fragment Vertex shader Transforms Interpolation Processor Buffer GPU Small vertex AGP shaders GPU Texture Memory Generation V: GeForce6/X800 (2004) GeForce 7800 GTX GeForce 7900 GTX ATI Radeon X1800 ATI Radeon X1900 • Simultaneous rendering to multiple buffers • True conditionals and loops Transistor Count 302 million 278 million 321 million 384 million • Texture access by vertex shdhader Die Area 333 mm2 196 mm2 288 mm2 352 mm2 • PCI-e bus Core Clock Speed 430 MHz 650 MHz 625 MHz 650 MHz • More memory/program length/texture accesses • GPU is idle, move towards smarter fragments, rather # Pixel Shaders 24 24 16 48 than more and more geometry. # Pixel Pipes 24 24 16 16 # Texturing Units 24 24 16 16 Rasterization Programmable # Vertex Pipes 8 8 8 9 Vertex Programmable Frame and Fragment Vertex shader Transforms Interpolation Processor Buffer Memory Interface 256 bit 256 bit 256 bit ext (512 int) 256 bit ext (512 int) Mem Clock Speed 1.2 GHz GDDR3 1.6 GHz GDDR3 1.5 GHz GDDR3 1.55 GHz GDDR3 Peak Mem Bwdth 38.4 GB/sec 51.2 GB/sec 48.0 GB/sec 49.6 GB/sec PCI-Express GPU Texture Memory Texture Memory Generation V: GeForce8800/HD2900 (2006) y Normal mapping (Direct3D 9) y Redesign of the GPU (more later) y Support for DirectX 10 ((oemore later ) y Geometry Shader y Madness continues– and you get to be part of it! Programmable Programmable Input Programmable Raster Geometry Pixel Assembler Vertex shader Operations Shader Shader PCI-Express Output Merger y Displacement Mapping (Direct3D 10) y Where are we now in this rapid era of mind‐blowing performance with unleashed creativity? y The latest nVidia offering, the GeForce GTX280, has upwards of 1.4 Billion transistors! y DirectX 10.1 has been released.