1Advanced Computer Graphics Advanced Computer Graphics (Fall 2009)(Fall 2009)CS 294, Rendering Lecture 7: High Quality Real-Time RenderingRavi Ramamoorthihttp://inst.eecs.berkeley.edu/~cs294-13/fa09MotivationMotivation Today, we create photorealistic computer graphics Complex geometry, realistic lighting, materials, shadows Computer-generated movies/special effects (difficult to tell real from rendered…) But algorithms are very slow (hours to days)RealReal--Time RenderingTime Rendering Goal is interactive rendering. Critical in many apps Games, visualization, computer-aided design, … So far, focus on complex geometry Chasm between interactivity, realismEvolution of 3D graphics renderingEvolution of 3D graphics renderingInteractive 3D graphics pipeline as in OpenGL Earliest SGI machines (Clark 82) to today Most of focus on more geometry, texture mapping Some tweaks for realism (shadow mapping, accum. buffer)SGI Reality Engine 93(Kurt Akeley)Offline 3D Graphics RenderingOffline 3D Graphics RenderingRay tracing, radiosity, global illumination High realism (global illum, shadows, refraction, lighting,..) But historically very slow techniques“So, while you and your children’s children are waiting for ray tracing to take over the world, what do you do in the meantime?” Real-Time Rendering 1sted.Pictures courtesy Henrik Wann JensenNew Trend: Acquired DataNew Trend: Acquired Data Image-Based Rendering: Real/precomputed images as input Also, acquire geometry, lighting, materials from real world Easy to obtain or precompute lots of high quality data. But how do we represent and reuse this for (real-time) rendering?210 years ago10 years ago High quality rendering: ray tracing, global illum., image-based rendering (This is what a rendering course would cover) Real-Time rendering: Interactive 3D geometry with simple texture mapping, maybe fake shadows (OpenGL, DirectX) Complex environment lighting, real materials (velvet, satin, paints), soft shadows, caustics often omitted in both Realism, interactivity at cross purposes TodayToday Vast increase in CPU power, modern instrs (SSE, Multi-Core) Real-time raytracing techniques are possible 4thgeneration of graphics hardware is programmable (First 3 gens were wireframe, shaded, textured) Modern nVidia, ATI cards allow vertex, fragment shaders Great deal of current work on acquiring and rendering with realistic lighting, materials… [Especially at Berkeley] Focus on quality of rendering, not quantity of polygons, textureGoalsGoals Overview of basic techniques for high-quality real-time rendering Survey of important concepts and ideas, but do not go into details of writing code Some pointers to resources, others on web One possibility for assignment 2, will need to think about some ideas on your ownOutlineOutline Motivation and Demos Programmable Graphics Pipeline Shadow Maps Environment MappingHigh quality realHigh quality real--time renderingtime rendering Photorealism, not just more polygons Natural lighting, materials, shadowsInteriors by architect Frank Gehry. Note rich lighting, rangingfrom localized sources to reflections off vast sheets of glass.High quality realHigh quality real--time renderingtime rendering Photorealism, not just more polygons Natural lighting, materials, shadowsReal materials diverse and not easy to represent by simple parameteric models. Want to support measured reflectance. Glass VaseGlass Star (courtesy Intel)Peacock feather3High quality realHigh quality real--time renderingtime rendering Photorealism, not just more polygons Natural lighting, materials, shadowsNatural lighting creates a mix of soft diffuse and hard shadows.Agrawala et al. 00small area light, sharp shadowssoft and hard shadowsNg et al. 03Programmable Graphics HardwareProgrammable Graphics HardwarePrecomputationPrecomputation--Based MethodsBased Methods Static geometry Precomputation Real-Time Rendering (relight all-frequency effects) Involves sophisticated representations, algorithmsRelit ImagesRelit ImagesNg, Ramamoorthi, Hanrahan 04 Video: RealVideo: Real--Time RelightingTime RelightingFollowed by demo with real-time relighting with causticsInteractive Interactive RayTracingRayTracingAdvantages Very complex scenes relatively easy (hierarchical bbox) Complex materials and shading for free Easy to add global illumination, specularities etc.Disadvantages Hard to access data in memory-coherent way Many samples for complex lighting and materials Global illumination possible but expensiveModern developments: Leverage power of modern CPUs, develop cache-aware, parallel implementationsDemo http://www.youtube.com/watch?v=blfxI1cVOzU4OutlineOutline Motivation and Demos Programmable Graphics Pipeline Shadow Maps Environment MappingBasic Hardware PipelineBasic Hardware PipelineApplicationGeometryRasterizerCPUGPUCreate geometry, lights, materials, textures, cubemaps, … as inputsTransform and lighting calcs.Apply per-vertex operationsTextures, CubemapsPer-pixel (per-fragment)operationsGeometry or Vertex PipelineGeometry or Vertex PipelineModel, ViewTransformLightingProjection Clipping ScreenThese fixed function stages can be replaced by a general per-vertexcalculation using vertex shaders in modern programmable hardwarePixel or Fragment PipelinePixel or Fragment PipelineRasterization(scan conversion)TextureMappingZ-bufferingFramebufferThese fixed function stages can be replaced by a general per-fragmentcalculation using fragment shaders in modern programmable hardwareShading LanguagesShading Languages Vertex / Fragment shading described by small program Written in language similar to C but with restrictions Long history. Cook’s paper on Shade Trees, Renderman for offline rendering Stanford Real-Time Shading Language, work at SGI Cg from NVIDIA, HLSL GLSL directly compatible with OpenGL 2.0 (So, you can just read the OpenGL Red Book to get started)ShaderShaderSetupSetupCliff Lindsay web.cs.wpi.edu/~rich/courses/imgd4000-d09/lectures/gpu.pdf5Cliff Lindsay web.cs.wpi.edu/~rich/courses/imgd4000-d09/lectures/gpu.pdf Cliff Lindsay web.cs.wpi.edu/~rich/courses/imgd4000-d09/lectures/gpu.pdfOutlineOutline Motivation and Demos Programmable Graphics Pipeline Shadow Maps Environment MappingShadow and Environment MapsShadow and Environment Maps Basic
View Full Document