Texture Mapping II Light Maps Light Maps Environment

Total Page:16

File Type:pdf, Size:1020Kb

Texture Mapping II Light Maps Light Maps Environment Texture Mapping II Light Maps •Light maps • Simulates the effect of a local light source •Environment Maps • Projective Textures += • Bump Maps • Displacement Maps • Solid Textures • Can be pre-computed and dynamically •Mipmaps adapted •Shadows 1 2 7. Texture Mapping 7. Texture Mapping Light Maps Environment Map • Texture mapping in Quake 3 4 textures only textures and light maps 7. Texture Mapping 7. Texture Mapping Environment Map Examples – Environment Map • Method to render reflective objects (θ,φ) • Compute intersection of reflected ray with n surrounding sphere • Take parameter values of intersection as texture coordinates 5 6 7. Texture Mapping 7. Texture Mapping Environment Map Cube Mapping • How to get an environment map of a real • Sphere can be replaced by cube environment? • Simplify computations 7 8 7. Texture Mapping 7. Texture Mapping Cube Map Demo Linear Mapping • Uses object or eye coordinates • (In)dependent of transforms • Can be used to visualize distance from objects y -x z-z 9 10 http://developer.nvidia.com/object/cube_map_ogl_tutorial.html 7. Texture Mapping x 7. Texture Mapping An Example Projective Textures • Mapping of distances from laser range data • Generalize texture coordinates to a 4D homogeneous vector (u, v, r, q) • Texture matrix computes full 4x4 transform to (up, vp) used for texture lookup • Texture image can be projected independently of viewing projection • Applications: – Slide projector – Spotlight simulation 11 12 7. Texture Mapping 7. Texture Mapping Projection Examples Polygon Screen Texture Eye 13 14 7. Texture Mapping 7. Texture Mapping Examples Bump Mapping • Adding surface detail without adding geometry • Perturbation of surface normal • Details interact with light • Bumps are small compared to geometry • Bump pattern is taken from a (texture-) map • Can also be procedural (fractals) 15 16 Ö movie 7. Texture Mapping 7. Texture Mapping Bump Mapping Bump Mapping • Given a surface p(u,v) and • Partial derivatives at point p’ p a perturbation value b (Jim Blinn) ’ ∂p' ∂p ∂ (bn) b = + ∂p ∂p ∂u ∂u ∂u n n = × = p ×p p ∂u ∂v u v Bump •Point p’ on the bumpy surface pattern • Perturbed normal approximated by (see Blinn) bn p' = p + n' = n + b (n×p )+ b (n×p ) n u u v v • Compute normal at Point p’ ∂p' ∂p' 17 18 n' = × ∂u ∂v 7. Texture Mapping 7. Texture Mapping Bump Mapping Examples • Discretization using Finite Differences b(u ,v )− b(u ,v )+ b(u ,v )− b(u ,v ) b = 2 1 1 1 2 2 1 2 u 2 ∆u b(u ,v )− b(u ,v )+ b(u ,v )− b(u ,v ) b = 1 2 1 1 2 2 2 1 v 2 ∆v b(u1 ,v2) b(u2 ,v2) ∆v Sphere w/Diffuse Texture Swirly Bump Map Sphere w/Diffuse Texture & Bump Map 19 20 b(u1 ,v1) ∆u b(u2 ,v1) 7. Texture Mapping 7. Texture Mapping Examples Bump Mapping •What’s missing? – Bumps on silhouette – Self-occlusion – Self-shadowing Bump Map Cylinder w/Diffuse Texture Map Cylinder w/Texture Map & Bump Map 21 22 Ö movie 7. Texture Mapping 7. Texture Mapping Displacement Mapping Displacement Mapping • Use the texture map to displace the geometry Image from: Geometry Caching for Ray-Tracing Displacement Maps by Matt Pharr and Pat Hanrahan. note the detailed shadows cast by the stones 23 24 7. Texture Mapping 7. Texture Mapping Solid Textures Perlin Noise •3D bitmaps •Procedural textures 25 26 7. Texture Mapping 7. Texture Mapping Mip-Mapping Texture Interpolation • Minimized textures produce aliasing effects • Compute texture value (R,G,B) as function of (u,v,z) • Store texture at multiple levels-of-detail • Tri-linear interpolation •Usesmaller versions when far from camera • MIP comes from the Latin multum in parvo, meaning a multitude in a small space. v v v u u u 27 z 28 without mipmap with mipmap mipmap z 7. Texture Mapping 7. Texture Mapping Computation of the Mip Map Shadows • Why are shadows important? –Depth cue – Scene lighting – Realism – Contact points • Color = weighted average of nearby pixels (filter) •See gluBuild2DMipMaps() 29 30 from Fredo Durand’s graphics class… Ö demo 7. Texture Mapping 7. Texture Mapping Shadows as a Depth Cue For Intuition about Scene Lighting • Position of the light (e.g. sundial) • Hard shadows vs. soft shadows • Directional light vs. point light 31 32 7. Texture Mapping 7. Texture Mapping Cast Shadows on Planar Surfaces Limitations of Planar Shadows • Draw the object primitives a second time, • Does not produce self-shadows, shadows cast projected to the ground plane on other objects, shadows on curved surfaces, etc. 33 34 7. Texture Mapping 7. Texture Mapping Fake Shadows using Projective Shadow/View Duality Textures • A point is lit if it is • Separate obstacle and receiver visible from the light • Compute b/w image of obstacle from light source • Use image as projective texture for each receiver Image from light source BW image of obstacle Final image • Shadow computation similar to view computation 35 36 7. Texture Mapping Figure from Moller & Haines “Real Time Rendering” 7. Texture Mapping Projective Texture Shadow Shadow Maps Limitations • Must specify occluder & receiver • In Renderman (High-end production software) •No self-shadows • In Games (GPUs) • Resolution Image from light source BW image of obstacle Final image 37 38 Figure from Moller & Haines “Real Time Rendering” 7. Texture Mapping 7. Texture Mapping Shadow Mapping Shadow Map Look Up • Texture mapping with • We have a 3D point (x,y,z)WS depth information • How do we look up •Requires 2 passes the depth from the through the pipeline: shadow map? (x',y',z')LS (x,y,z)WS – Compute shadow • Use the 4x4 map (depth from perspective projection light source) matrix from the light – Render final image, check shadow map source to get (x',y',z')LS to see if points are • ShadowMap(x',y') < z'? Foley et al. “Computer Graphics Principles and Practice” Foley et al. “Computer Graphics Principles and Practice” in shadow 39 40 7. Texture Mapping 7. Texture Mapping Limitations of Shadow Maps 1. Field of View Problem 1. Field of View • What if point to shadow is outside 2. Bias (Epsilon) field of view of 3. Aliasing shadow map? – Use cubical shadow map –Use only spot lights! Foley et al. “Computer Graphics Principles and Practice” Foley et al. “Computer Graphics Principles and Practice” 41 42 7. Texture Mapping 7. Texture Mapping 2. The Bias (Epsilon) Nightmare 2. Bias (Epsilon) for Shadow Maps • For a point visible • ShadowMap(x’,y’) + bias < z’ from the light • Choosing a good bias value can be very tricky source ShadowMap(x’,y’) ≈ z’ •How can we avoid erroneous self-shadowing? Foley et al. “Computer Graphics Principles and Practice” – Add bias (epsilon) Correct image Not enough bias Way too much bias 43 44 7. Texture Mapping 7. Texture Mapping 3. Shadow Map Aliasing 3. Shadow Map Filtering • Under-sampling of the shadow map • Should we filter the depth? • Reprojection aliasing – especially bad when the (weighted average of neighboring depth camera & light are opposite each other values) • No... filtering depth is not meaningful 45 46 7. Texture Mapping 7. Texture Mapping 3. Percentage Closer Filtering 3. Percentage Closer Filtering • Instead filter the result of the test •5x5 samples (weighted average of comparison results) • Nice antialiased • But makes the bias issue more tricky shadow • Using a bigger filter produces fake soft shadows • Setting bias is tricky 47 48 7. Texture Mapping 7. Texture Mapping Projective Texturing + Shadow Map Shadows in Production •Often use shadow maps • Ray casting as fallback in case of robustness issues Light’s View Depth/Shadow Map Eye’s View Images from Cass Everitt et al., “Hardware Shadow Mapping” NVIDIA SDK White Paper 49 50 7. Texture Mapping 7. Texture Mapping Hardware Shadow Maps Shadow Volumes • Can be done with hardware texture mapping • Explicitly represent the volume – Texture coordinates u,v,w generated using 4x4 of space in shadow matrix •For each polygon – Modern hardware permits tests on texture values – Pyramid with point light as apex – Include polygon to cap •Shadow test similar to clipping 51 52 7. Texture Mapping 7. Texture Mapping Shadow Volumes Shadow Volumes • If a point is inside a shadow • Shoot a ray from the eye to volume cast by a particular light, the visible point the point does not receive any • Increment/decrement a illumination from that light counter each time we intersect a shadow • Cost of naive volume polygon -1 +1 implementation: • If the counter ≠ 0, +1 #polygons * #lights the point is in shadow 53 54 7. Texture Mapping 7. Texture Mapping Optimizing Shadow Volumes Limitations of Shadow Volumes • Use silhouette edges only (edge where • Introduces a lot of new geometry a back-facing & front-facing polygon meet) • Expensive to rasterize long skinny triangles • Objects must be watertight to use silhouette trick L • Rasterization of polygons sharing an edge must not overlap & must not have gap A 55 56 7. Texture Mapping 7. Texture Mapping Homework 57 58 7. Texture Mapping 7. Texture Mapping.
Recommended publications
  • Relief Texture Mapping
    Advanced Texturing Environment Mapping Environment Mapping ° reflections Environment Mapping ° orientation ° Environment Map View point Environment Mapping ° ° ° Environment Map View point Environment Mapping ° Can be an “effect” ° Usually means: “fake reflection” ° Can be a “technique” (i.e., GPU feature) ° Then it means: “2D texture indexed by a 3D orientation” ° Usually the index vector is the reflection vector ° But can be anything else that’s suitable! ° Increased importance for modern GI Environment Mapping ° Uses texture coordinate generation, multi-texturing, new texture targets… ° Main task ° Map all 3D orientations to a 2D texture ° Independent of application to reflections Sphere Cube Dual paraboloid Top top Top Left Front Right Left Front Right Back left front right Bottom Bottom Back bottom Cube Mapping ° OpenGL texture targets Top Left Front Right Back Bottom glTexImage2D( GL_TEXTURE_CUBE_MAP_POSITIVE_X , 0, GL_RGB8, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, face_px ); Cube Mapping ° Cube map accessed via vectors expressed as 3D texture coordinates (s, t, r) +t +s -r Cube Mapping ° 3D 2D projection done by hardware ° Highest magnitude component selects which cube face to use (e.g., -t) ° Divide other components by this, e.g.: s’ = s / -t r’ = r / -t ° (s’, r’) is in the range [-1, 1] ° remap to [0,1] and select a texel from selected face ° Still need to generate useful texture coordinates for reflections Cube Mapping ° Generate views of the environment ° One for each cube face ° 90° view frustum ° Use hardware render to texture
    [Show full text]
  • Generating Real Time Reflections by Ray Tracing Approximate Geometry
    Generating Real Time Reflections by Ray Tracing Approximate Geometry Master’s thesis in Interaction Design and Technologies JOHAN FREDRIKSSON, ADAM SCOTT Department of Interaction Design and Technologies CHALMERS UNIVERSITY OF TECHNOLOGY Gothenburg, Sweden 2016 Master’s thesis 2016:123 Generating Real Time Reflections by Ray Tracing Approximate Geometry JOHAN FREDRIKSSON, ADAM SCOTT Department of Computer Science Division of Interaction Design and Technologies Chalmers University of Technology Gothenburg, Sweden 2016 Generating Real Time Reflections by Ray Tracing Approximate Geometry JOHAN FREDRIKSSON, ADAM SCOTT © JOHAN FREDRIKSSON, ADAM SCOTT, 2016. Supervisor: Erik Sintorn, Computer Graphics Examiner: Staffan Björk, Interaction Design and Technologies Master’s Thesis 2016:123 Department of Computer Science Division of Interaction Design and Technologies Chalmers University of Technology SE-412 96 Gothenburg Cover: BVH encapsulating approximate geometry created in the Frostbite engine. Typeset in LATEX Gothenburg, Sweden 2016 iii Generating Real Time Reflections by Ray Tracing Approximated Geometry Johan Fredriksson, Adam Scott Department of Interaction Design and Technologies Chalmers University of Technology Abstract Rendering reflections in real time is important for realistic modern games. A com- mon way to provide reflections is by using environment mapping. This method is not an accurate way to calculate reflections and it consumes a lot of memory space. We propose a method of ray tracing approximate geometry in real time. By using approximate geometry it can be kept simple and the size of the bounding volume hierarchy will have a lower memory impact. The ray tracing is performed on the GPU and the bounding volumes are pre built on the CPU using surface area heuris- tics.
    [Show full text]
  • Brno University of Technology Rendering Of
    BRNO UNIVERSITY OF TECHNOLOGY VYSOKÉ UČENÍ TECHNICKÉ V BRNĚ FACULTY OF INFORMATION TECHNOLOGY FAKULTA INFORMAČNÍCH TECHNOLOGIÍ DEPARTMENT OF COMPUTER GRAPHICS AND MULTIMEDIA ÚSTAV POČÍTAČOVÉ GRAFIKY A MULTIMÉDIÍ RENDERING OF NONPLANAR MIRRORS ZOBRAZOVÁNÍ POKŘIVENÝCH ZRCADEL MASTER’S THESIS DIPLOMOVÁ PRÁCE AUTHOR Bc. MILOSLAV ČÍŽ AUTOR PRÁCE SUPERVISOR Ing. TOMÁŠ MILET VEDOUCÍ PRÁCE BRNO 2017 Abstract This work deals with the problem of accurately rendering mirror reflections on curved surfaces in real-time. While planar mirrors do not pose a problem in this area, non-planar surfaces are nowadays rendered mostly using environment mapping, which is a method of approximating the reflections well enough for the human eye. However, this approach may not be suitable for applications such as CAD systems. Accurate mirror reflections can be rendered with ray tracing methods, but not in real-time and therefore without offering interactivity. This work examines existing approaches to the problem and proposes a new algorithm for computing accurate mirror reflections in real-time using accelerated searching for intersections with depth profile stored in cubemap textures. This algorithm has been implemented using OpenGL and tested on different platforms. Abstrakt Tato práce se zabývá problémem přesného zobrazování zrcadlových odrazů na zakřiveném povrchu v reálném čase. Zatímco planární zrcadla nepředstavují v tomto ohledu problém, zakřivené povrchy se v dnešní době zobrazují především metodou environment mapping, která aproximuje reálné odrazy a nabízí výsledky uspokojivé pro lidské oko. Tento přístup však nemusí být vhodný např. v oblasti CAD systémů. Přesných zrcadlových odrazů se dá dosáhnout pomocí metod sledování paprsku, avšak ne v reálném čase a tudíž bez možnosti interaktivity.
    [Show full text]
  • 235-242.Pdf (449.2Kb)
    Eurographics/ IEEE-VGTC Symposium on Visualization (2007) Ken Museth, Torsten Möller, and Anders Ynnerman (Editors) Hardware-accelerated Stippling of Surfaces derived from Medical Volume Data Alexandra Baer Christian Tietjen Ragnar Bade Bernhard Preim Department of Simulation and Graphics Otto-von-Guericke University of Magdeburg, Germany {abaer|tietjen|rbade|preim}@isg.cs.uni-magdeburg.de Abstract We present a fast hardware-accelerated stippling method which does not require any preprocessing for placing points on surfaces. The surfaces are automatically parameterized in order to apply stippling textures without ma- jor distortions. The mapping process is guided by a decomposition of the space in cubes. Seamless scaling with a constant density of points is realized by subdividing and summarizing cubes. Our mip-map technique enables ar- bitrarily scaling with one texture. Different shading tones and scales are facilitated by adhering to the constraints of tonal art maps. With our stippling technique, it is feasible to encode all scaling and brightness levels within one self-similar texture. Our method is applied to surfaces extracted from (segmented) medical volume data. The speed of the stippling process enables stippling for several complex objects simultaneously. We consider applica- tion scenarios in intervention planning (neck and liver surgery planning). In these scenarios, object recognition (shape perception) is supported by adding stippling to semi-transparently shaded objects which are displayed as context information. Categories and Subject Descriptors (according to ACM CCS): I.3.7 [Computer Graphics]: Three-Dimensional Graphics and Realism -Color, shading, shadowing, and texture 1. Introduction from breathing, pulsation or patient movement. Without a well-defined curvature field, hatching may be misleading by The effective visualization of complex anatomic surfaces is a emphasizing erroneous features of the surfaces.
    [Show full text]
  • 2.5D 3D Axis-Aligned Bounding Box (AABB) Albedo Alpha Blending
    This page is dedicated to describing the commonly used terms when working with CRYENGINE V. As a use case, you may find yourself asking questions like "What is a Brush", "What is a Component", or Overview | Sections | # | A | B | C | D | E "What is POM?", this page will highlight and provide descriptions for those types of questions and more. | F | G | H | I | J | L | M | N | O | P | Q | R Once you have an understanding of what each term means, links are provided for more documentation | S | T | V | Y | Z and guidance on working with them. 2.5D Used to describe raycasting engines, such as Doom or Duke Nukem. The maps are generally drawn as 2D bitmaps with height properties but when rendered gives the appearance of being 3D. 3D Refers to the ability to move in the X, Y and Z axis and also rotate around the X, Y, and Z axes. Axis-aligned Bounding Box A form of a bounding box where the box is aligned to the axis therefore only two points in space are (AABB) needed to define it. AABB’s are much faster to use, and take up less memory, but are very limited in the sense that they can only be aligned to the axis. Albedo An albedo is a physical measure of a material’s reflectivity, generally across the visible spectrum of light. An albedo texture simulates a surface albedo as opposed to explicitly defining a colour for it. Alpha Blending Assigning varying levels of translucency to graphical objects, allowing the creation of things such as glass, fog, and ghosts.
    [Show full text]
  • Real-Time Recursive Specular Reflections on Planar and Curved Surfaces Using Graphics Hardware
    REAL-TIME RECURSIVE SPECULAR REFLECTIONS ON PLANAR AND CURVED SURFACES USING GRAPHICS HARDWARE Kasper Høy Nielsen Niels Jørgen Christensen Informatics and Mathematical Modelling The Technical University of Denmark DK 2800 Lyngby, Denmark {khn,njc}@imm.dtu.dk ABSTRACT Real-time rendering of recursive reflections have previously been done using different techniques. How- ever, a fast unified approach for capturing recursive reflections on both planar and curved surfaces, as well as glossy reflections and interreflections between such primitives, have not been described. This paper describes a framework for efficient simulation of recursive specular reflections in scenes containing both planar and curved surfaces. We describe and compare two methods that utilize texture mapping and en- vironment mapping, while having reasonable memory requirements. The methods are texture-based to allow for the simulation of glossy reflections using image-filtering. We show that the methods can render recursive reflections in static and dynamic scenes in real-time on current consumer graphics hardware. The methods make it possible to obtain a realism close to ray traced images at interactive frame rates. Keywords: Real-time rendering, recursive specular reflections, texture, environment mapping. 1 INTRODUCTION mapped surface sees the exact same surroundings re- gardless of its position. Static precalculated environ- Mirror-like reflections are known from ray tracing, ment maps can be used to create the notion of reflec- where shiny objects seem to reflect the surrounding tion on shiny objects. However, for modelling reflec- environment. Rays are continuously traced through tions similar to ray tracing, reflections should capture the scene by following reflected rays recursively un- the actual synthetic environment as accurately as pos- til a certain depth is reached, thereby capturing both sible, while still being feasible for interactive render- reflections and interreflections.
    [Show full text]
  • Ray Tracing Tutorial
    Ray Tracing Tutorial by the Codermind team Contents: 1. Introduction : What is ray tracing ? 2. Part I : First rays 3. Part II : Phong, Blinn, supersampling, sRGB and exposure 4. Part III : Procedural textures, bump mapping, cube environment map 5. Part IV : Depth of field, Fresnel, blobs 2 This article is the foreword of a serie of article about ray tracing. It's probably a word that you may have heard without really knowing what it represents or without an idea of how to implement one using a programming language. This article and the following will try to fill that for you. Note that this introduction is covering generalities about ray tracing and will not enter into much details of our implementation. If you're interested about actual implementation, formulas and code please skip this and go to part one after this introduction. What is ray tracing ? Ray tracing is one of the numerous techniques that exist to render images with computers. The idea behind ray tracing is that physically correct images are composed by light and that light will usually come from a light source and bounce around as light rays (following a broken line path) in a scene before hitting our eyes or a camera. By being able to reproduce in computer simulation the path followed from a light source to our eye we would then be able to determine what our eye sees. Of course it's not as simple as it sounds. We need some method to follow these rays as the nature has an infinite amount of computation available but we have not.
    [Show full text]
  • (543) Lecture 7 (Part 2): Texturing Prof Emmanuel
    Computer Graphics (543) Lecture 7 (Part 2): Texturing Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second Many phenomena even more detailed Clouds Grass Terrain Skin Computationally inexpensive way to add details Image complexity does not affect the complexity of geometry processing 2 (transformation, clipping…) Textures in Games Everthing is a texture except foreground characters that require interaction Even details on foreground texture (e.g. clothes) is texture Types of Texturing 1. geometric model 2. texture mapped Paste image (marble) onto polygon Types of Texturing 3. Bump mapping 4. Environment mapping Simulate surface roughness Picture of sky/environment (dimples) over object Texture Mapping 1. Define texture position on geometry 2. projection 4. patch texel 3. texture lookup 3D geometry 2D projection of 3D geometry t 2D image S Texture Representation Bitmap (pixel map) textures: images (jpg, bmp, etc) loaded Procedural textures: E.g. fractal picture generated in .cpp file Textures applied in shaders (1,1) t Bitmap texture: 2D image - 2D array texture[height][width] Each element (or texel ) has coordinate (s, t) s and t normalized to [0,1] range Any (s,t) => [red, green, blue] color s (0,0) Texture Mapping Map? Each (x,y,z) point on object, has corresponding (s, t) point in texture s = s(x,y,z) t = t(x,y,z) (x,y,z) t s texture coordinates world coordinates 6 Main Steps to Apply Texture 1. Create texture object 2. Specify the texture Read or generate image assign to texture (hardware) unit enable texturing (turn on) 3.
    [Show full text]
  • NVIDIA Opengl Extension Specifications
    NVIDIA OpenGL Extension Specifications NVIDIA OpenGL Extension Specifications NVIDIA Corporation Mark J. Kilgard, editor [email protected] May 21, 2001 1 NVIDIA OpenGL Extension Specifications Copyright NVIDIA Corporation, 1999, 2000, 2001. This document is protected by copyright and contains information proprietary to NVIDIA Corporation as designated in the document. Other OpenGL extension specifications can be found at: http://oss.sgi.com/projects/ogl-sample/registry/ 2 NVIDIA OpenGL Extension Specifications Table of Contents Table of NVIDIA OpenGL Extension Support.............................. 4 ARB_imaging........................................................... 6 ARB_multisample....................................................... 7 ARB_multitexture..................................................... 18 ARB_texture_border_clamp............................................. 19 ARB_texture_compression.............................................. 25 ARB_texture_cube_map................................................. 48 ARB_texture_env_add.................................................. 62 ARB_texture_env_combine.............................................. 65 ARB_texture_env_dot3................................................. 73 ARB_transpose_matrix................................................. 76 EXT_abgr............................................................. 81 EXT_bgra............................................................. 84 EXT_blend_color...................................................... 86 EXT_blend_minmax....................................................
    [Show full text]
  • Environment Mapping
    CS 418: Interactive Computer Graphics Environment Mapping Eric Shaffer Some slides adapted from Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015 Environment Mapping How can we render reflections with a rasterization engine? When shading a fragment, usually don’t know other scene geometry Answer: use texture mapping…. Create a texture of the environment Map it onto mirror object surface Any suggestions how generate (u,v)? Types of Environment Maps Sphere Mapping Classic technique… Not supported by WebGL OpenGL supports sphere mapping which requires a circular texture map equivalent to an image taken with a fisheye lens Sphere Mapping Example 5 Sphere Mapping Limitations Visual artifacts are common Sphere mapping is view dependent Acquisition of images non-trivial Need fisheye lens Or render from fisheye lens Cube maps are easier to acquire Or render Acquiring a Sphere Map…. Take a picture of a shiny sphere in a real environment Or render the environment into a texture (see next slide) Why View Dependent? Conceptually a sphere map is generated like ray-tracing Records reflection under orthographic projection From a given view point What is a drawback of this? Cube Map Cube mapping takes a different approach…. Imagine an object is in a box …and you can see the environment through that box 9 Forming a Cube Map Reflection Mapping How Does WebGL Index into Cube Map? •To access the cube map you compute R = 2(N·V)N-V •Then, in your shader vec4 texColor = textureCube(texMap, R); V R •How does WebGL
    [Show full text]
  • Texture Mapping Effects
    CS 543 Computer Graphics Texture Mapping Effects by Cliff Lindsay “Top Ten List” Courtesy of David Letterman’s Late Show and CBS Talk Format List of Texture Mapping Effects from Good to Spectacular (my biased opinion): Highlights: . Define Each Effect . Describe Each Effect Briefly: Theory and Practice. Talk about how each effect extends the idea of general Texture Mapping (previous talk) including Pros and Cons. Demos of selected Texture Mapping Effects 1 Texture Mapping Effect #10 Light Mapping Main idea: Static diffuse lighting contribution for a surface can be captured in a texture and blended with another texture representing surface detail. Highlights: . Eliminate lighting calculation overhead . Light maps are low resolution . Light maps can be applied to multiple textures * = [Images courtesy of flipcode.com] Light Mapping Below is a night scene of a castle. No lighting calculation is being performed at all in the scene. Left: No Light Map applied Right: Light Map applied [Images courtesy of www.gamasutra.com] 2 Texture Mapping Effect #9 Non-Photorealistic Rendering Main idea: Recreating an environment that is focused on depicting a style or communicating a motif as effectively as possible. This is in contrast to Photorealistic which tries to create as real a scene as possible. High lights of NPR: . Toon Shading . Artistic styles (ink, water color, etc.) . Perceptual rendering [Robo Model with and without Toon Shading, Image courtesy of Michael Arias] Non-Photorealistic Rendering Non-Photorealistic Rendering Simple Example: Black
    [Show full text]
  • Polygons Feel No Pain 2014
    Polygons Feel No Pain Volume 1 Ingemar Ragnemalm Course book for TSBK07 Computer Graphics 1 Foreword Why would anyone name a computer graphics book “Polygons feel no pain”? In case you wonder, here are the reasons: • Computer graphics is very much about polygons. • Computer games tend to be violent and I am aiming for gaming! • A major point with it is to inflict less pain (in your back) than the others do. • It is a whole lot more fun than yet another book entitled “Computer Graphics with OpenGL”. So the message is that computer graphics is fun, computer games are fun too, and blasting some grunts in Quake doesn’t hurt anyone. Let’s start the game. INSERT COIN(S) TO CONTINUE... Cover image by Susanne Ragnemalm, based on the original Candide model. Related web pages: http://www.computer-graphics.se http://www.isy.liu.se http://www.ragnemalm.se All content of this book is © Ingemar Ragnemalm 2008-2014. Revised january 2014. 2 1. Introduction This book was written as course material for my course in Computer Graphics at Linköping University. There are many computer graphics books, including the Hearn&Baker book [9] that was course book for our course for many years. That book is excellent in many areas, low-level algorithms and splines in particular. However, the amount of material that was missing for my needs kept growing, and whatever book I con- sidered as replacement seemed to miss just as much. And they are all big books that don’t slip as easily into the backpack as they should.
    [Show full text]