Texture Mapping. Texture Mapping. Map textures to surfaces. Trompe L Oeil ( Deceive the Eye ) The texture. Texture map
|
|
- Daniel Reeves
- 6 years ago
- Views:
Transcription
1 CSCI 42 Computer Graphic Lecture 2 Texture Mapping A way of adding urface detail Texture Mapping Jernej Barbic Univerity of Southern California Texture Mapping + Shading Filtering and Mipmap Non-color Texture Map [Angel Ch. 7] Two way can achieve the goal: Model the urface with more polygon» Slow down rendering peed» Hard to model fine feature Map a texture to the urface» Thi lecture» Image complexity doe not affect complexity of proceing Efficiently upported in hardware 2 Trompe L Oeil ( Deceive the Eye ) Map texture to urface Window and column in the dome are painted, not a real 3D object texture map Similar idea with texture mapping: Jeuit Church, Vienna, Autria Rather than modeling the intricate 3D geometry, replace it with an image! 3 an image image mapped to a 3D polygon The polygon can have arbitrary ize, hape and 3D poition 4 The texture Texture map Texture i a bitmap image Can ue an image library to load image into memory Or can create image yourelf within the program (,) (,) (,) (,) 2D array: unigned char texture[height][width][4] Or unrolled into D array: unigned char texture[4*height*width] Pixel of the texture are called texel Texel coordinate caled to [,] range (,) texture image (,) (,) 3D polygon (,) 5 6
2 Texture map Texture coordinate (,) (,) (,) (,) (,) (,) texture image (,) 3D polygon (,) 7 texture image creen image For each pixel, lookup into the texture image to obtain color. 8 The t coordinate ytem t Note: alo called uv pace t (.,.7) Texture mapping: key lide (.7,.55) (,,) =. t =.7 triangle in 3D (-2,,) =.7 t =.55 9 (.35,.5) (2,-,) =.35 t =.5 Specifying texture coordinate in OpenGL (core profile) Specifying texture coordinate in OpenGL (compatibility profile) Ue VBO Either create a eparate VBO for texture coordinate, or put them with vertex poition into one VBO =. t =.7 =.7 t =.55 =.35 t =.5 Ue gltexcoord2f State machine: Texture coordinate remain valid until you change them Example (from the previou lide) : glenable(gl_texture_2d); // turn texture mapping on glbegin(gl_triangles); =. t =.7 gltexcoord2f(.35,.5); glvertex3f(2.,-.,.); gltexcoord2f(.7,.55); glvertex3f(-2.,.,.); gltexcoord2f(.,.7); glvertex3f(.,.,.); glend(); gldiable(gl_texture_2d); // turn texture mapping off =.7 t =.55 =.35 t =.5 2 2
3 t What if texture coordinate are outide of [,]? Solution : Repeat texture gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_S, GL_REPEAT) gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_T, GL_REPEAT) t 3 4 Solution 2: Clamp to [,] gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE) gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE) t ue thi color Combining texture mapping and hading 5 Source: Jeremy Birn 6 Outline Texture interpolation Introduction Filtering and Mipmap Non-color texture map Texture mapping in OpenGL 5 x 5 texture T (,) coordinate typically not directly at pixel in the texture, but in between 7 (,) (.25,) (.5,) (.75,) (,) 8 3
4 Texture interpolation coordinate typically not directly at pixel in the texture, but in between Solution: Ue the nearet neighbor to determine color» Fater, but wore quality» gltexparameteri(gl_texture_2d, GL_TEXTURE_MIN_FILTER, GL_NEAREST); Linear interpolation» Incorporate color of everal neighbor to determine color» Slower, better quality» gltexparameteri(gl_texture_2d, GL_TEXTURE_MIN_FILTER, GL_LINEAR) Texture image i hrunk in ditant part of the image Thi lead to aliaing Can be fixed with filtering bilinear in pace trilinear in pace and level of detail (mipmapping) Filtering aliaing 9 2 Mipmapping Pre-calculate how the texture hould look at variou ditance, then ue the appropriate texture at each ditance Reduce / fixe the aliaing problem Mipmapping Each mipmap (each image below) repreent a level of depth (LOD). Decreae image 2x at each level 2 22 Mipmapping in OpenGL Generate mipmap automatically (for the currently bound texture): Core profile: glgeneratemipmap(gl_texture_2d); Compatibility profile: glubuild2dmipmap(gl_texture_2d, component, width, height, format, type, data) Outline Introduction Filtering and Mipmap Non-color texture map Texture mapping in OpenGL Mut alo intruct OpenGL to ue mipmap: gltexparameteri(gl_texture_2d, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR)
5 Texture do not have to repreent color Specularity (patche of hinine) Tranparency (patche of clearne) Normal vector change (bump map) Reflected light (environment map) Bump mapping How do you make a urface look rough? Option : model the urface with many mall polygon Option 2: perturb the normal vector before the hading calculation» Fake mall diplacement above or below the true urface» The urface doen t actually change, but hading make it look like there are irregularitie!» A texture tore information about the fake height of the urface Shadow Change in urface height (diplacement map) Bump mapping We can perturb the normal vector without having to make any actual change to the hape. Thi illuion can be een through how? Light Mapping Quake ue light map in addition to texture map. Texture map are ued to add detail to urface, and light map are ued to tore pre-computed illumination. The two are multiplied together at runtime, and cached for efficiency. Texture Map Only Texture + Light Map Original model (5M) Simplified (5) Simple model with bump map 27 Light Map 28 Outline Introduction Filtering and Mipmap Non-color texture map Texture mapping in OpenGL 29 OpenGL Texture Mapping (Core Profile) During initialization:. Read texture image from file into an array in memory, or generate the image uing your program 2. Initialize the texture (glteximage2d) 3. Specify texture mapping parameter:» Repeat/clamp, filtering, mipmapping, etc. 4. Make VBO for the texture coordinate 5. Create VAO In diplay():. Bind VAO 2. Select the texture unit, and texture (uing glbindtexture) 3. Render (e.g., gldrawarray) 3 5
6 Read texture image from file into an array in memory Can ue our ImageIO library ImageIO * imageio = new ImageIO(); if (imageio->loadjpeg(imagefilename)!= ImageIO::OK) cout << Error reading image << imagefilename <<. << endl; exit(exit_failure); See tarter code for hw2 Initializing the texture Do once during initialization, for each texture image in the cene, by calling glteximage2d The dimenion of texture image mut be a multiple of 4 (Note: they do NOT have to be a power of 2) Can load texture dynamically if GPU memory i carce: Delete a texture (if no longer needed) uing gldeletetexture 3 32 glteximage2d glteximage2d(gl_texture_2d, level, internalformat, width, height, border, format, type, data) GL_TEXTURE_2D: pecifie that it i a 2D texture Level: ued for pecifying level of detail for mipmapping (default: ) InternalFormat Often: GL_RGB or GL_RGBA Determine how the texture i tored internally Width, Height The ize of the texture mut be a multiple of 4 Border (often et to ) Format, Type Specifie what the input data i (GL_RGB, GL_RGBA, ) Specifie the input data type (GL_UNSIGNED_BYTE, GL_BYTE, ) Regardle of Format and Type, OpenGL convert the data to internalformat Data: pointer to the image buffer 33 Global variable: GLUint texhandle; During initialization: Texture Initialization // create an integer handle for the texture glgentexture(, &texhandle); int code = inittexture( ky.jpg, texhandle); if (code!= ) printf( Error loading the texture image.\n ); exit(exit_failure); Function inittexture() i given in the tarter code for hw2. 34 VBO Layout: poition, texture coordinate (for 2 vertice) VBO gg5 53v ff&$ # d ^^3d aa7y oart J^23 Gr/% po x po y po z po2 x in vec3 poition 4 byte per floating-point value po2 po2 y z tc u tc v tc2 u in vec2 texcoord tc2 v 35 #verion 5 in vec3 poition; in vec2 texcoord; out vec2 tc; Texture Shader: Vertex Program uniform mat4 modelviewmatrix; uniform mat4 projectionmatrix; input vertex poition and texture coordinate output texture coordinate; they will be paed to the fragment program (interpolated by hardware) tranformation matrice void main() // compute the tranformed and projected vertex poition (into gl_poition) gl_poition = projectionmatrix * modelviewmatrix * vec4(poition,.f); // pa-through the texture coordinate tc = texcoord; 36 6
7 Texture Shader: Fragment Program #verion 5 in vec2 tc; // input tex coordinate (computed by the interpolator) out vec4 c; // output color (the final fragment color) uniform ampler2d textureimage; // the texture image void main() // compute the final fragment color, // by looking up into the texture map c = texture(textureimage, tc); VAO code ( texcoord hader variable) During initialization: glbindvertexarray(vao); // bind the VAO // bind the VBO buffer (mut be previouly created) glbindbuffer(gl_array_buffer, buffer); // get location index of the texcoord hader variable GLuint loc = glgetattriblocation(program, texcoord ); glenablevertexattribarray(loc); // enable the texcoord attribute // et the layout of the texcoord attribute data cont void * offet = (cont void*) izeof(poition); GLizei tride = ; glvertexattribpointer(loc, 2, GL_FLOAT, GL_FALSE, tride, offet); Multitexturing The ability to ue multiple texture imultaneouly in a hader Ueful for bump mapping, diplacement mapping, etc. The different texture unit are denoted by GL_TEXTURE, GL_TEXTURE, GL_TEXTURE2, etc. In imple application (our homework), we only need one unit void ettextureunit(glint unit) glactivetexture(unit); // elect the active texture unit // get a handle to the textureimage hader variable GLint h_textureimage = glgetuniformlocation(program, textureimage ); // deem the hader variable textureimage to read from texture unit unit gluniformi(h_textureimage, unit - GL_TEXTURE); 39 The diplay function void diplay() // put all the uual code here (clear creen, et up camera, upload // the modelview matrix and projection matrix to GPU, etc.) // // elect the active texture unit ettextureunit(gl_texture); // it i afe to alway ue GL_TEXTURE // elect the texture to ue ( texhandle wa generated by glgentexture) glbindtexture(gl_texture_2d, texhandle); // here, bind the VAO and render the object uing the VAO (a uual) // glutswapbuffer(); 4 Texture mapping in OpenGL (Compatibility Profile) During your initialization:. Read texture image from file into an array in memory, or generate the image uing your program 2. Specify texture mapping parameter» Wrapping, filtering, etc. 3. Initialize and activate the texture In diplay():. Enable OpenGL texture mapping 2. Draw object: Aign texture coordinate to vertice 3. Diable OpenGL texture mapping 4 Enable/diable texture mode (Compatibility Profile) Mut be done before rendering any primitive that are to be texture-mapped glenable(gl_texture_2d) gldiable(gl_texture_2d) Succeively enable/diable texture mode to witch between drawing textured/non-textured polygon Changing texture: Only one texture i active at any given time (with OpenGL extenion, more than one can be ued imultaneouly; thi i called multitexturing) Ue glbindtexture to elect the active texture 42 7
8 Rendering (compatibility profile) void diplay() // no modulation of texture color with lighting; ue texture color directly gltexenvf(gl_texture_env, GL_TEXTURE_ENV_MODE, GL_REPLACE); Rendering (compatibility profile) (part 2) glbegin(gl_quads); // draw a textured quad gltexcoord2f(.,.); glvertex3f(-2.,-.,.); gltexcoord2f(.,.); glvertex3f(-2.,.,.); gltexcoord2f(.,.); glvertex3f(.,.,.); gltexcoord2f(.,.); glvertex3f(.,-.,.); glend(); // turn on texture mapping (thi diable tandard OpenGL lighting, unle in GL_MODULATE mode) glenable(gl_texture_2d); // turn off texture mapping gldiable(gl_texture_2d); (continue on next page) 43 // draw ome non-texture mapped object (tandard OpenGL lighting will be ued if it i enabled) // witch back to texture mode, etc. // end diplay() 44 Summary Introduction Filtering and Mipmap Non-color texture map Texture mapping in OpenGL 45 8
Texture Mapping. Texture Mapping. Map textures to surfaces. Trompe L Oeil ( Deceive the Eye ) Texture map. The texture
CSCI 48 Compuer Graphic Lecure Texure Mapping A way of adding urface deail Texure Mapping February 5, 22 Jernej Barbic Univeriy of Souhern California Texure Mapping + Shading Filering and Mipmap Non-color
More informationGraphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실.
Graphics Texture Mapping 고려대학교컴퓨터그래픽스연구실 3D Rendering Pipeline 3D Primitives 3D Modeling Coordinates Model Transformation 3D World Coordinates Lighting 3D World Coordinates Viewing Transformation 3D Viewing
More informationLecture 22 Sections 8.8, 8.9, Wed, Oct 28, 2009
s The s Lecture 22 Sections 8.8, 8.9, 8.10 Hampden-Sydney College Wed, Oct 28, 2009 Outline s The 1 2 3 4 5 The 6 7 8 Outline s The 1 2 3 4 5 The 6 7 8 Creating Images s The To create a texture image internally,
More informationCS 432 Interactive Computer Graphics
CS 432 Interactive Computer Graphics Lecture 7 Part 2 Texture Mapping in OpenGL Matt Burlick - Drexel University - CS 432 1 Topics Texture Mapping in OpenGL Matt Burlick - Drexel University - CS 432 2
More informationLecture 19: OpenGL Texture Mapping. CITS3003 Graphics & Animation
Lecture 19: OpenGL Texture Mapping CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Introduce the OpenGL texture functions and options
More informationTexture Mapping. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science
Texture Mapping CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce Mapping Methods - Texture Mapping - Environment Mapping - Bump Mapping Consider
More informationGRAFIKA KOMPUTER. ~ M. Ali Fauzi
GRAFIKA KOMPUTER ~ M. Ali Fauzi Texture Mapping WHY TEXTURE? Imagine a Chess Floor Or a Brick Wall How to Draw? If you want to draw a chess floor, each tile must be drawn as a separate quad. A large flat
More informationTexture Mapping. Mike Bailey.
Texture Mapping 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License TextureMapping.pptx The Basic Idea
More informationCT5510: Computer Graphics. Texture Mapping
CT5510: Computer Graphics Texture Mapping BOCHANG MOON Texture Mapping Simulate spatially varying surface properties Phong illumination model is coupled with a material (e.g., color) Add small polygons
More informationก ก ก.
418382 ก ก ก ก 5 pramook@gmail.com TEXTURE MAPPING Textures Texture Object An OpenGL data type that keeps textures resident in memory and provides identifiers
More informationShaders. Introduction. OpenGL Grows via Extensions. OpenGL Extensions. OpenGL 2.0 Added Shaders. Shaders Enable Many New Effects
CSCI 420 Computer Graphics Lecture 4 Shaders Jernej Barbic University of Southern California Shading Languages GLSL Vertex Array Objects Vertex Shader Fragment Shader [Angel Ch. 1, 2, A] Introduction The
More informationTextures. Texture Mapping. Bitmap Textures. Basic Texture Techniques
Texture Mapping Textures The realism of an image is greatly enhanced by adding surface textures to the various faces of a mesh object. In part a) images have been pasted onto each face of a box. Part b)
More informationApplying Textures. Lecture 27. Robb T. Koether. Hampden-Sydney College. Fri, Nov 3, 2017
Applying Textures Lecture 27 Robb T. Koether Hampden-Sydney College Fri, Nov 3, 2017 Robb T. Koether (Hampden-Sydney College) Applying Textures Fri, Nov 3, 2017 1 / 24 Outline 1 Applying Textures 2 Photographs
More informationCSE 167: Introduction to Computer Graphics Lecture #7: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018
CSE 167: Introduction to Computer Graphics Lecture #7: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018 Announcements Project 2 due this Friday at 2pm Grading in
More informationLecture 07: Buffers and Textures
Lecture 07: Buffers and Textures CSE 40166 Computer Graphics Peter Bui University of Notre Dame, IN, USA October 26, 2010 OpenGL Pipeline Today s Focus Pixel Buffers: read and write image data to and from
More informationCS212. OpenGL Texture Mapping and Related
CS212 OpenGL Texture Mapping and Related Basic Strategy Three steps to applying a texture 1. specify the texture read or generate image assign to texture enable texturing 2. assign texture coordinates
More informationFog example. Fog is atmospheric effect. Better realism, helps determine distances
Fog example Fog is atmospheric effect Better realism, helps determine distances Fog Fog was part of OpenGL fixed function pipeline Programming fixed function fog Parameters: Choose fog color, fog model
More informationCISC 3620 Lecture 7 Lighting and shading. Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping
CISC 3620 Lecture 7 Lighting and shading Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping Exam results Grade distribution 12 Min: 26 10 Mean: 74 8 Median:
More informationCS452/552; EE465/505. Texture Mapping in WebGL
CS452/552; EE465/505 Texture Mapping in WebGL 2-26 15 Outline! Texture Mapping in WebGL Read: Angel, Chapter 7, 7.3-7.5 LearningWebGL lesson 5: http://learningwebgl.com/blog/?p=507 Lab3 due: Monday, 3/2
More informationCS4621/5621 Fall Basics of OpenGL/GLSL Textures Basics
CS4621/5621 Fall 2015 Basics of OpenGL/GLSL Textures Basics Professor: Kavita Bala Instructor: Nicolas Savva with slides from Balazs Kovacs, Eston Schweickart, Daniel Schroeder, Jiang Huang and Pramook
More information三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒
三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒 1 In this chapter, you will learn The basics of texture mapping Texture coordinates Texture objects and texture binding Texture specification
More informationCSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016
CSE 167: Introduction to Computer Graphics Lecture #8: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016 Announcements Project 2 due this Friday Midterm next Tuesday
More informationBuffers. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015
Buffers 1 Objectives Introduce additional WebGL buffers Reading and writing buffers Buffers and Images 2 Buffer Define a buffer by its spatial resolution (n x m) and its depth (or precision) k, the number
More informationDiscussion 3. PPM loading Texture rendering in OpenGL
Discussion 3 PPM loading Texture rendering in OpenGL PPM Loading - Portable PixMap format 1. 2. Code for loadppm(): http://ivl.calit2.net/wiki/images/0/09/loadppm.txt ppm file format: Header: 1. P6: byte
More informationLighting and Texturing
Lighting and Texturing Michael Tao Michael Tao Lighting and Texturing 1 / 1 Fixed Function OpenGL Lighting Need to enable lighting Need to configure lights Need to configure triangle material properties
More informationCSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017
CSE 167: Introduction to Computer Graphics Lecture #8: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017 Announcements Project 2 is due this Friday at 2pm Next Tuesday
More informationComputergraphics Exercise 15/ Shading & Texturing
Computergraphics Exercise 15/16 3. Shading & Texturing Jakob Wagner for internal use only Shaders Vertex Specification define vertex format & data in model space Vertex Processing transform to clip space
More informationSteiner- Wallner- Podaras
Texturing 2 3 Some words on textures Texturing = mapping 2D image to a model (*You will hear more on other texturing- methods in the course.) Not a trivial task! 4 Texturing how it works 5 UV coordinates
More informationObjectives. Texture Mapping and NURBS Week 7. The Limits of Geometric Modeling. Modeling an Orange. Three Types of Mapping. Modeling an Orange (2)
CS 480/680 INTERACTIVE COMPUTER GRAPHICS Texture Mapping and NURBS Week 7 David Breen Department of Computer Science Drexel University Objectives Introduce Mapping Methods Texture Mapping Environmental
More informationOpenGL Texture Mapping. Objectives Introduce the OpenGL texture functions and options
OpenGL Texture Mapping Objectives Introduce the OpenGL texture functions and options 1 Basic Strategy Three steps to applying a texture 1. 2. 3. specify the texture read or generate image assign to texture
More informationTexture Mapping CSCI 4229/5229 Computer Graphics Fall 2016
Texture Mapping CSCI 4229/5229 Computer Graphics Fall 2016 What are texture maps? Bitmap images used to assign fine texture to displayed surfaces Used to make surfaces appear more realistic Must move with
More informationTexture Mapping. Computer Graphics, 2015 Lecture 9. Johan Nysjö Centre for Image analysis Uppsala University
Texture Mapping Computer Graphics, 2015 Lecture 9 Johan Nysjö Centre for Image analysis Uppsala University What we have rendered so far: Looks OK, but how do we add more details (and colors)? Texture mapping
More informationTexture Mapping and Sampling
Texture Mapping and Sampling CPSC 314 Wolfgang Heidrich The Rendering Pipeline Geometry Processing Geometry Database Model/View Transform. Lighting Perspective Transform. Clipping Scan Conversion Depth
More informationOverview. By end of the week:
Overview By end of the week: - Know the basics of git - Make sure we can all compile and run a C++/ OpenGL program - Understand the OpenGL rendering pipeline - Understand how matrices are used for geometric
More informationCS179: GPU Programming
CS179: GPU Programming Lecture 4: Textures Original Slides by Luke Durant, Russel McClellan, Tamas Szalay Today Recap Textures What are textures? Traditional uses Alternative uses Recap Our data so far:
More information+ = Texturing: Glue n-dimensional images onto geometrical objects. Texturing. Texture magnification. Texture coordinates. Bilinear interpolation
Texturing Slides done bytomas Akenine-Möller and Ulf Assarsson Chalmers University of Technology Texturing: Glue n-dimensional images onto geometrical objects Purpose: more realism, and this is a cheap
More informationTexturing. Slides done bytomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology
Texturing Slides done bytomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology 1 Texturing: Glue n-dimensional images onto geometrical objects l Purpose:
More informationGrafica Computazionale
Grafica Computazionale lezione36 Informatica e Automazione, "Roma Tre" June 3, 2010 Grafica Computazionale: Lezione 33 Textures Introduction Steps in Texture Mapping A Sample Program Texturing algorithms
More informationINF3320 Computer Graphics and Discrete Geometry
INF3320 Computer Graphics and Discrete Geometry Texturing Christopher Dyken Martin Reimers 06.10.2010 Page 1 Texturing Linear interpolation Real Time Rendering: Chapter 5: Visual Appearance Chapter 6:
More informationTSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY
1(61) Information Coding / Computer Graphics, ISY, LiTH TSBK 07 Computer Graphics Ingemar Ragnemalm, ISY 1(61) Lecture 6 Texture mapping Skyboxes Environment mapping Bump mapping 2(61)2(61) Texture mapping
More informationTexture and other Mappings
Texture and other Mappings Texture Mapping Bump Mapping Displacement Mapping Environment Mapping Example: Checkerboard Particularly severe problems in regular textures 1 The Beginnings of a Solution: Mipmapping
More informationCS335 Graphics and Multimedia. Slides adopted from OpenGL Tutorial
CS335 Graphics and Multimedia Slides adopted from OpenGL Tutorial Texture Poly. Per Vertex Mapping CPU DL Texture Raster Frag FB Pixel Apply a 1D, 2D, or 3D image to geometric primitives Uses of Texturing
More informationOUTLINE. Implementing Texturing What Can Go Wrong and How to Fix It Mipmapping Filtering Perspective Correction
TEXTURE MAPPING 1 OUTLINE Implementing Texturing What Can Go Wrong and How to Fix It Mipmapping Filtering Perspective Correction 2 BASIC STRAGEGY Three steps to applying a texture 1. specify the texture
More informationGeneral Purpose computation on GPUs. Liangjun Zhang 2/23/2005
General Purpose computation on GPUs Liangjun Zhang 2/23/2005 Outline Interpretation of GPGPU GPU Programmable interfaces GPU programming sample: Hello, GPGPU More complex programming GPU essentials, opportunity
More informationTexture mapping. Computer Graphics CSE 167 Lecture 9
Texture mapping Computer Graphics CSE 167 Lecture 9 CSE 167: Computer Graphics Texture Mapping Overview Interpolation Wrapping Texture coordinates Anti aliasing Mipmaps Other mappings Including bump mapping
More informationSUMMARY. CS380: Introduction to Computer Graphics Texture Mapping Chapter 15. Min H. Kim KAIST School of Computing 18/05/03.
CS380: Introduction to Computer Graphics Texture Mapping Chapter 15 Min H. Kim KAIST School of Computing Materials SUMMARY 2 1 Light blob from PVC plastic Recall: Given any vector w (not necessarily of
More informationShading. Flat shading Gouraud shading Phong shading
Shading Flat shading Gouraud shading Phong shading Flat Shading and Perception Lateral inhibition: exaggerates perceived intensity Mach bands: perceived stripes along edges Icosahedron with Sphere Normals
More information-=Catmull's Texturing=1974. Part I of Texturing
-=Catmull's Texturing=1974 but with shaders Part I of Texturing Anton Gerdelan Textures Edwin Catmull's PhD thesis Computer display of curved surfaces, 1974 U.Utah Also invented the z-buffer / depth buffer
More informationMethodology for Lecture
Basic Geometry Setup Methodology for Lecture Make mytest1 more ambitious Sequence of steps Demo Review of Last Demo Changed floor to all white, added global for teapot and teapotloc, moved geometry to
More informationTexturing. Slides done by Tomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology
Texturing Slides done by Tomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology 1 Texturing: Glue n-dimensional images onto geometrical objects l Purpose:
More informationCMSC 425: Lecture 12 Texture Mapping Thursday, Mar 14, 2013
CMSC 425: Lecture 12 Texture Mapping Thursday, Mar 14, 2013 Surface Detail: We have discussed the use of lighting as a method of producing more realistic images. This is fine for smooth surfaces of uniform
More informationTexturas. Objectives. ! Introduce Mapping Methods. ! Consider two basic strategies. Computação Gráfica
Texturas Computação Gráfica Objectives! Introduce Mapping Methods! Texture Mapping! Environmental Mapping! Bump Mapping! Light Mapping! Consider two basic strategies! Manual coordinate specification! Two-stage
More informationComputer Graphics. Bing-Yu Chen National Taiwan University
Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering
More informationCOMP371 COMPUTER GRAPHICS
COMP371 COMPUTER GRAPHICS SESSION 12 PROGRAMMABLE SHADERS Announcement Programming Assignment #2 deadline next week: Session #7 Review of project proposals 2 Lecture Overview GPU programming 3 GPU Pipeline
More informationCSE 167: Introduction to Computer Graphics Lecture #9: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013
CSE 167: Introduction to Computer Graphics Lecture #9: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 Announcements Added Tuesday office hours for Krishna: 11am-12
More informationComputational Strategies
Computational Strategies How can the basic ingredients be combined: Image Order Ray casting (many options) Object Order (in world coordinate) splatting, texture mapping Combination (neither) Shear warp,
More informationCap. 3 Textures. Mestrado em Engenharia Informática (6931) 1º ano, 1º semestre
Cap. 3 Textures Mestrado em Engenharia Informática (6931) 1º ano, 1º semestre Overview Objectives Notion of texture Motivation Texture mapping, texture patterns, and texels Mapping textures to polygons,
More informationComputergrafik. Matthias Zwicker Universität Bern Herbst 2016
Computergrafik Matthias Zwicker Universität Bern Herbst 2016 2 Today Basic shader for texture mapping Texture coordinate assignment Antialiasing Fancy textures 3 Texture mapping Glue textures (images)
More informationMipmaps. Lecture 23 Subsection Fri, Oct 30, Hampden-Sydney College. Mipmaps. Robb T. Koether. Discrete Sampling.
Lecture 23 Subsection 8.8.2 Hampden-Sydney College Fri, Oct 30, 2009 Outline 1 2 3 4 5 dumay.info Outline 1 2 3 4 5 dumay.info Suppose we are drawing a 2-dimensional black-and-white checkerboard pattern.
More informationOpenGL & Visualization
OpenGL & Visualization Martin Ilčík Institute of Computer Graphics and Algorithms Vienna University of Technology Motivation What is OpenGL How to use OpenGL Slices with OpenGL GPU raycasting Martin Ilčík
More informationComputer Graphics. Three-Dimensional Graphics VI. Guoying Zhao 1 / 73
Computer Graphics Three-Dimensional Graphics VI Guoying Zhao 1 / 73 Texture mapping Guoying Zhao 2 / 73 Objectives Introduce Mapping Methods Texture Mapping Environment Mapping Bump Mapping Consider basic
More informationLecture 5 3D graphics part 3
Lecture 5 3D graphics part 3 Shading; applying lighting Surface detail: Mappings Texture mapping Light mapping Bump mapping Surface detail Shading: takes away the surface detail of the polygons Texture
More informationCSE 167: Lecture 11: Textures 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011
CSE 167: Introduction to Computer Graphics Lecture 11: Textures 2 Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 Announcements Homework assignment #5 due Friday, Nov 4,
More informationPractical Texturing (WebGL) CS559 Fall 2016 Lecture 20 November 7th 2016
Practical Texturing (WebGL) CS559 Fall 2016 Lecture 20 November 7th 2016 In brief Starting with a simple model In brief Caveat : Issues with sampling & aliasing associate texture coordinates with primitives
More informationDepartment of Computer Sciences Graphics Spring 2013 (Lecture 19) Bump Maps
Bump Maps The technique of bump mapping varies the apparent shape of the surface by perturbing the normal vectors as the surface is rendered; the colors that are generated by shading then show a variation
More informationCS452/552; EE465/505. Image Processing Frame Buffer Objects
CS452/552; EE465/505 Image Processing Frame Buffer Objects 3-12 15 Outline! Image Processing: Examples! Render to Texture Read: Angel, Chapter 7, 7.10-7.13 Lab3 new due date: Friday, Mar. 13 th Project#1
More informationCPSC 436D Video Game Programming
CPSC 436D Video Game Programming OpenGL/Shaders Opengl RENDERING PIPELINE Copyright: Alla Sheffer 1 Opengl RENDERING PIPELINE C/C++ OpenGL GLSL (automatic) (automatic) GLSL (automatic) opengl Low-level
More informationBest practices for effective OpenGL programming. Dan Omachi OpenGL Development Engineer
Best practices for effective OpenGL programming Dan Omachi OpenGL Development Engineer 2 What Is OpenGL? 3 OpenGL is a software interface to graphics hardware - OpenGL Specification 4 GPU accelerates rendering
More informationCSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science
CSC 307 1.0 Graphics Programming Department of Statistics and Computer Science Graphics Programming Texture Mapping 2 Texture Poly. Per Vertex Mapping CPU DL Pixel Texture Raster Frag FB Apply a 1D, 2D,
More informationTo Do. Review of Last Demo. Methodology for Lecture. Geometry Basic Setup. Outline. Foundations of Computer Graphics (Fall 2012)
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 8: OpenGL 2 http://inst.eecs.berkeley.edu/~cs184 To Do Continue working on HW 2. Can be difficult Class lectures, programs primary source Can
More informationShading/Texturing. Dr. Scott Schaefer
Shading/Texturing Dr. Scott Schaefer Problem / Problem / Problem 4/ Problem / Problem / Shading Algorithms Flat Shading Gouraud Shading Phong Shading / Flat Shading Apply same color across entire polygon
More informationCSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014
CSE 167: Introduction to Computer Graphics Lecture #6: Lights Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014 Announcements Project 2 due Friday, Oct. 24 th Midterm Exam
More informationCS GPU and GPGPU Programming Lecture 12: GPU Texturing 1. Markus Hadwiger, KAUST
CS 380 - GPU and GPGPU Programming Lecture 12: GPU Texturing 1 Markus Hadwiger, KAUST Reading Assignment #6 (until Mar. 17) Read (required): Programming Massively Parallel Processors book, Chapter 4 (CUDA
More informationIntroduction to OpenGL
Introduction to OpenGL Banafsheh Azari http://www.uni-weimar.de/cms/medien/cg.html What You ll See Today What is OpenGL? Related Libraries OpenGL Command Syntax B. Azari http://www.uni-weimar.de/cms/medien/cg.html
More informationComp 410/510 Computer Graphics Spring Programming with OpenGL Part 4: Three Dimensions
Comp 410/510 Computer Graphics Spring 2018 Programming with OpenGL Part 4: Three Dimensions Objectives Develop a bit more sophisticated three-dimensional example - Rotating cube Introduce hidden-surface
More informationComputer Graphics Texture Mapping
! Computer Graphics 2013! 13. Texture Mapping Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2013-10-28 About the final examination - Next Friday (Nov. 8th) Night, - 7:30PM - 9:00PM (one and
More informationToday. Texture mapping in OpenGL. Texture mapping. Basic shaders for texturing. Today. Computergrafik
Computergrafik Today Basic shader for texture mapping Texture coordinate assignment Antialiasing Fancy textures Matthias Zwicker Universität Bern Herbst 2009 Texture mapping Glue textures (images) onto
More information2/3/16. Interaction. Triangles (Clarification) Choice of Programming Language. Buffer Objects. The CPU-GPU bus. CSCI 420 Computer Graphics Lecture 3
CSCI 420 Computer Graphics Lecture 3 Interaction Jernej Barbic University of Southern California [Angel Ch. 2] Triangles (Clarification) Can be any shape or size Well-shaped triangles have advantages for
More informationCS GPU and GPGPU Programming Lecture 11: GPU Texturing 1. Markus Hadwiger, KAUST
CS 380 - GPU and GPGPU Programming Lecture 11: GPU Texturing 1 Markus Hadwiger, KAUST Reading Assignment #6 (until Mar. 9) Read (required): Programming Massively Parallel Processors book, Chapter 4 (CUDA
More informationIntroduction to Computer Graphics with WebGL
1 Introduction to Computer Graphics with WebGL Ed Angel Lighting in WebGL WebGL lighting Application must specify - Normals - Material properties - Lights State-based shading functions have been deprecated
More informationFAKULTI TEKNOLOGI MAKLUMAT DAN KOMUNIKASI BITM INTERACTIVE COMPUTER GRAPHICS LAB SESSION 4. C++ - OpenGL
FAKULTI TEKNOLOGI MAKLUMAT DAN KOMUNIKASI BITM 3213 - INTERACTIVE COMPUTER GRAPHICS LAB SESSION 4 C++ - OpenGL Part 1- C++ - Texture Mapping 1. Download texture file and put it into your current folder
More informationInteraction. CSCI 420 Computer Graphics Lecture 3
CSCI 420 Computer Graphics Lecture 3 Interaction Jernej Barbic University of Southern California Client/Server Model Callbacks Double Buffering Hidden Surface Removal Simple Transformations [Angel Ch.
More informationCS GPU and GPGPU Programming Lecture 16+17: GPU Texturing 1+2. Markus Hadwiger, KAUST
CS 380 - GPU and GPGPU Programming Lecture 16+17: GPU Texturing 1+2 Markus Hadwiger, KAUST Reading Assignment #10 (until April 23) Read (required): Brook for GPUs: Stream Computing on Graphics Hardware
More informationCS 432 Interactive Computer Graphics
CS 432 Interactive Computer Graphics Lecture 2 Part 2 Introduction to Shaders Matt Burlick - Drexel University - CS 432 1 Shaders To understand shaders, let s look at the graphics pipeline again The job
More informationINF3320 Computer Graphics and Discrete Geometry
INF3320 Computer Graphics and Discrete Geometry Texturing Christopher Dyken Martin Reimers 06.10.2010 Page 1 Texturing Linear interpolation Real Time Rendering: Chapter 5: Visual Appearance Chapter 6:
More informationAnnouncements. Written Assignment 2 is out see the web page. Computer Graphics
Announcements Written Assignment 2 is out see the web page 1 Texture and other Mappings Shadows Texture Mapping Bump Mapping Displacement Mapping Environment Mapping Watt Chapter 8 COMPUTER GRAPHICS 15-462
More informationIntroduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL Ed Angel The Mandelbrot Set Fractals Fractal (fractional geometry) objects generate some of the most complex and beautiful graphics - The mathematics describing
More informationCSE 167: Lecture #17: Volume Rendering. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012
CSE 167: Introduction to Computer Graphics Lecture #17: Volume Rendering Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Thursday, Dec 13: Final project presentations
More informationAMCS / CS 247 Scientific Visualization Lecture 10: (GPU) Texture Mapping. Markus Hadwiger, KAUST
AMCS / CS 247 Scientific Visualization Lecture 10: (GPU) Texture Mapping Markus Hadwiger, KAUST Reading Assignment #5 (until Oct. 8) Read (required): Real-Time Volume Graphics, Chapter 2 (GPU Programming)
More informationImage I/O and OpenGL Textures
Image I/O and OpenGL Textures Creating Images Using dynamic memory allocation we can create an array for an RGB image. The easiest way to do this is as follows Create an array based on the Width, Height
More informationTutorial 3: Texture Mapping
Tutorial 3: Texture Mapping Summary In this tutorial, you are going to learn about texture mapping, by performing some texture mapping operations on the triangle you ve been using in the previous tutorials.
More informationPage 6 PROCESSOR PROCESSOR FRAGMENT FRAGMENT. texy[1] texx. texy[1] texx. texy[0] texy[0]
This lecture is based on GPGPU::Basic Math Tutorial, Dominik Goeddeke, http:www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html 220 Winter 2009 CMPE A linear algebra application GPGPU: SAXPY stands
More informationComputer Graphics
01076536 Computer Graphics Chapter 10 llumination Models and Surface-Rendering Methods Somsak Walairacht, Computer Engineering, KMTL 1 Outline Light Sources Surface Lighting Effects Basic llumination Models
More informationCS 130 Final. Fall 2015
CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying
More informationProgrammable Graphics Hardware
CSCI 480 Computer Graphics Lecture 14 Programmable Graphics Hardware [Ch. 9] March 2, 2011 Jernej Barbic University of Southern California OpenGL Extensions Shading Languages Vertex Program Fragment Program
More informationImaging and Raster Primitives
Realtime 3D Computer Graphics & Virtual Reality Bitmaps and Textures Imaging and Raster Primitives Vicki Shreiner Imaging and Raster Primitives Describe OpenGL s raster primitives: bitmaps and image rectangles
More informationChapter 9 Texture Mapping An Overview and an Example Steps in Texture Mapping A Sample Program Specifying the Texture Texture Proxy Replacing All or
Chapter 9 Texture Mapping An Overview and an Example Steps in Texture Mapping A Sample Program Specifying the Texture Texture Proxy Replacing All or Part of a Texture Image One Dimensional Textures Using
More informationAssignment #5: Scalar Field Visualization 3D: Direct Volume Rendering
Assignment #5: Scalar Field Visualization 3D: Direct Volume Rendering Goals: Due October 4 th, before midnight This is the continuation of Assignment 4. The goal is to implement a simple DVR -- 2D texture-based
More informationShadow Rendering. CS7GV3 Real-time Rendering
Shadow Rendering CS7GV3 Real-time Rendering Global Illumination The incoming radiance L i (p,l) at some point p is the outgoing L o (r(p,l)-l) from another point A Recursive Term r(r(p,l), l ) r(r(r(p,l),
More informationTextures. Datorgrafik 2006
Textures Datorgrafik 2006 Reading Material MUST read These slides OH 139-172 by Magnus Bondesson Texturing, mipmapping, multitexturing, environment mapping OH 173-174 Bump mapping OH 175-200 3D-textures,
More information