Grafica Computazionale
|
|
- Sandra Gregory
- 5 years ago
- Views:
Transcription
1 Grafica Computazionale lezione36 Informatica e Automazione, "Roma Tre" June 3, 2010
2 Grafica Computazionale: Lezione 33 Textures Introduction Steps in Texture Mapping A Sample Program Texturing algorithms
3 Contents Textures Introduction Steps in Texture Mapping A Sample Program Texturing algorithms
4 OpenGL examples source Main reference:
5 OpenGL examples source Main reference:
6 OpenGL examples source Main reference:
7 OpenGL examples source Main reference: Chapter 5 of Geometric Programming for Computer Aided Design
8 Teaching Texture Mapping Visually
9 It is cheaper to employ mapping techniques than to use myriads of tiny polygons
10 Steps in Texture Mapping
11 Steps in Texture Mapping 1. Create a texture object and specify a texture for that object.
12 Steps in Texture Mapping 1. Create a texture object and specify a texture for that object. 2. Indicate how the texture is to be applied to each pixel.
13 Steps in Texture Mapping 1. Create a texture object and specify a texture for that object. 2. Indicate how the texture is to be applied to each pixel. 3. Enable texture mapping.
14 Steps in Texture Mapping 1. Create a texture object and specify a texture for that object. 2. Indicate how the texture is to be applied to each pixel. 3. Enable texture mapping. 4. Draw the scene, supplying both texture and geometric coordinates.
15 checker.py In this program from red book, which is very simple, a single texture object is created to maintain a single uncompressed, two-dimensional texture
16 checker.py In this program from red book, which is very simple, a single texture object is created to maintain a single uncompressed, two-dimensional texture This example does not find out how much memory is available
17 checker.py In this program from red book, which is very simple, a single texture object is created to maintain a single uncompressed, two-dimensional texture This example does not find out how much memory is available Since only one texture is created, there is no attempt to prioritize or otherwise manage a working set of texture objects
18 checker.py In this program from red book, which is very simple, a single texture object is created to maintain a single uncompressed, two-dimensional texture This example does not find out how much memory is available Since only one texture is created, there is no attempt to prioritize or otherwise manage a working set of texture objects Other advanced techniques, such as texture borders, mipmaps, or cube maps, are not used in this simple example.
19 Create a Texture Object and Specify a Texture for That Object A texture is usually thought of as being two-dimensional, like most images
20 Create a Texture Object and Specify a Texture for That Object A texture is usually thought of as being two-dimensional, like most images but it can also be one-dimensional or three-dimensional
21 Create a Texture Object and Specify a Texture for That Object A texture is usually thought of as being two-dimensional, like most images but it can also be one-dimensional or three-dimensional The data describing a texture may consist of one, two, three, or four elements per texel
22 Create a Texture Object and Specify a Texture for That Object A texture is usually thought of as being two-dimensional, like most images but it can also be one-dimensional or three-dimensional The data describing a texture may consist of one, two, three, or four elements per texel and may represent an (R, G, B, A) quadruple, a modulation constant, or a depth component.
23 Create a Texture Object and Specify a Texture for That Object The checkerboard texture is generated in the routine makecheckimage(), and all the texture-mapping initialization occurs in the routine init()
24 Create a Texture Object and Specify a Texture for That Object The checkerboard texture is generated in the routine makecheckimage(), and all the texture-mapping initialization occurs in the routine init() glgentextures() and glbindtexture() name and create a texture object for a texture image
25 Create a Texture Object and Specify a Texture for That Object The checkerboard texture is generated in the routine makecheckimage(), and all the texture-mapping initialization occurs in the routine init() glgentextures() and glbindtexture() name and create a texture object for a texture image The single, full-resolution texture map is specified by glteximage2d(), whose parameters indicate the size, type, location, and other properties of the texture image
26 Create a Texture Object and Specify a Texture for That Object The checkerboard texture is generated in the routine makecheckimage(), and all the texture-mapping initialization occurs in the routine init() glgentextures() and glbindtexture() name and create a texture object for a texture image The single, full-resolution texture map is specified by glteximage2d(), whose parameters indicate the size, type, location, and other properties of the texture image (See Specifying the Texture for more information about glteximage2d().)
27 Indicate How the Texture Is to Be Applied to Each Pixel You can choose any of four possible functions for computing the final RGBA value from the fragment color and the texture image data
28 Indicate How the Texture Is to Be Applied to Each Pixel You can choose any of four possible functions for computing the final RGBA value from the fragment color and the texture image data One possibility is simply to use the texture color as the final color; this is the replace mode, in which the texture is painted on top of the fragment, just as a decal would be applied
29 Indicate How the Texture Is to Be Applied to Each Pixel You can choose any of four possible functions for computing the final RGBA value from the fragment color and the texture image data One possibility is simply to use the texture color as the final color; this is the replace mode, in which the texture is painted on top of the fragment, just as a decal would be applied (checker.py uses replace mode.) Another method is to use the texture to modulate, or scale, the fragment s color; this technique is useful for combining the effects of lighting with texturing
30 Indicate How the Texture Is to Be Applied to Each Pixel You can choose any of four possible functions for computing the final RGBA value from the fragment color and the texture image data One possibility is simply to use the texture color as the final color; this is the replace mode, in which the texture is painted on top of the fragment, just as a decal would be applied (checker.py uses replace mode.) Another method is to use the texture to modulate, or scale, the fragment s color; this technique is useful for combining the effects of lighting with texturing Finally, a constant color can be blended with that of the fragment, based on the texture value.
31 Indicate How the Texture Is to Be Applied to Each Pixel You can choose any of four possible functions for computing the final RGBA value from the fragment color and the texture image data (gltexenv)
32 Indicate How the Texture Is to Be Applied to Each Pixel You can choose any of four possible functions for computing the final RGBA value from the fragment color and the texture image data (gltexenv) use the texture color as the final color; this is the replace mode, in which the texture is painted on top of the fragment, just as a decal would be applied.
33 Indicate How the Texture Is to Be Applied to Each Pixel You can choose any of four possible functions for computing the final RGBA value from the fragment color and the texture image data (gltexenv) use the texture color as the final color; this is the replace mode, in which the texture is painted on top of the fragment, just as a decal would be applied. use the texture to modulate, or scale, the fragment s color; this technique is useful for combining the effects of lighting with texturing.
34 Indicate How the Texture Is to Be Applied to Each Pixel You can choose any of four possible functions for computing the final RGBA value from the fragment color and the texture image data (gltexenv) use the texture color as the final color; this is the replace mode, in which the texture is painted on top of the fragment, just as a decal would be applied. use the texture to modulate, or scale, the fragment s color; this technique is useful for combining the effects of lighting with texturing. a constant color can be *blend*ed with that of the fragment, based on the texture value.
35 checker.py The four calls to gltexparameter() specify how the texture is to be wrapped
36 checker.py The four calls to gltexparameter() specify how the texture is to be wrapped and how the colors are to be filtered if there isn t an exact match between texels in the texture and pixels on the screen
37 checker.py The four calls to gltexparameter() specify how the texture is to be wrapped and how the colors are to be filtered if there isn t an exact match between texels in the texture and pixels on the screen (See Filtering on page 434 and Repeating and Clamping Textures on page 452 of red book)
38 Enable Texture Mapping You need to enable texturing before drawing your scene
39 Enable Texture Mapping You need to enable texturing before drawing your scene Texturing is enabled or disabled using glenable() or gldisable(), with the symbolic constant GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_CUBE_MAP for one-, two-, three-dimensional, or cube map texturing, respectively
40 Enable Texture Mapping You need to enable texturing before drawing your scene Texturing is enabled or disabled using glenable() or gldisable(), with the symbolic constant GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_CUBE_MAP for one-, two-, three-dimensional, or cube map texturing, respectively If two or all three of the dimensional texturing modes are enabled, the largest dimension enabled is used
41 Enable Texture Mapping You need to enable texturing before drawing your scene Texturing is enabled or disabled using glenable() or gldisable(), with the symbolic constant GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_CUBE_MAP for one-, two-, three-dimensional, or cube map texturing, respectively If two or all three of the dimensional texturing modes are enabled, the largest dimension enabled is used If cube map textures are enabled, it trumps all the others
42 Enable Texture Mapping You need to enable texturing before drawing your scene Texturing is enabled or disabled using glenable() or gldisable(), with the symbolic constant GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_CUBE_MAP for one-, two-, three-dimensional, or cube map texturing, respectively If two or all three of the dimensional texturing modes are enabled, the largest dimension enabled is used If cube map textures are enabled, it trumps all the others For the sake of clean programs, you should enable only the one you want to use.
43 checker.py In display(),
44 checker.py In display(), glenable() turns on texturing
45 checker.py In display(), glenable() turns on texturing gltexenv() sets the drawing mode to GL_REPLACE so that the textured polygons are drawn using the colors from the texture map
46 checker.py In display(), glenable() turns on texturing gltexenv() sets the drawing mode to GL_REPLACE so that the textured polygons are drawn using the colors from the texture map rather than taking into account the color in which the polygons would have been drawn without the texture
47 Draw the Scene, Supplying Both Texture and Geometric Coordinates For a 2D texture map the texture coordinates range from 0.0 to 1.0 in both directions, but the coordinates of the items being textured can be anything
48 Draw the Scene, Supplying Both Texture and Geometric Coordinates For a 2D texture map the texture coordinates range from 0.0 to 1.0 in both directions, but the coordinates of the items being textured can be anything To apply the brick texture to a wall, for example, the code would probably assign texture coordinates (0, 0), (1, 0), (1, 1), and (0, 1) to the four corners of the wall
49 Draw the Scene, Supplying Both Texture and Geometric Coordinates For a 2D texture map the texture coordinates range from 0.0 to 1.0 in both directions, but the coordinates of the items being textured can be anything To apply the brick texture to a wall, for example, the code would probably assign texture coordinates (0, 0), (1, 0), (1, 1), and (0, 1) to the four corners of the wall If the wall is large, you might want to paint several copies of the texture map on it
50 Draw the Scene, Supplying Both Texture and Geometric Coordinates For a 2D texture map the texture coordinates range from 0.0 to 1.0 in both directions, but the coordinates of the items being textured can be anything To apply the brick texture to a wall, for example, the code would probably assign texture coordinates (0, 0), (1, 0), (1, 1), and (0, 1) to the four corners of the wall If the wall is large, you might want to paint several copies of the texture map on it If you do so, the texture map must be designed so that the bricks at the left edge match up nicely with the bricks at the right edge, and similarly for the bricks at the top and bottom.
51 checker.py Then, two polygons are drawn
52 checker.py Then, two polygons are drawn Note that texture coordinates are specified along with vertex coordinates
53 checker.py Then, two polygons are drawn Note that texture coordinates are specified along with vertex coordinates The gltexcoord() command behaves similarly to the glnormal() command
54 checker.py Then, two polygons are drawn Note that texture coordinates are specified along with vertex coordinates The gltexcoord() command behaves similarly to the glnormal() command gltexcoord() sets the current texture coordinates; any subsequent vertex command has those texture coordinates associated with it until gltexcoord() is called again.
55 Contents Textures Introduction Steps in Texture Mapping A Sample Program Texturing algorithms
56 """1* checker.c * This program texture maps a checker board image onto * two rectangles. * * * If running this program on DpenGL 1.0, texture objects are not used. *1""" from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * import nwnpy from array import * #1* Create checkerboard texture *1 checkimagewidth : 64 checkimageheight : 64 checkimage : nwnpy.array(bytearray(checkimagewidth*checkimageheight*4» texname : 1, #Remark: is a TUPLE def makecheckimage(checkimageheight,checkimagewidth): global checkimage def ind(i,j,k): return (i*checkimagewidth +j)*4 + k for i in range(checkimageheight): for j in range(checkimagewidth) : # [i & Ox8 for i in range(64)] a,b : (i & Ox8 :: 0)*1, (j & Ox8 :: 0)*1 if (a and not b) or (b and not a): c : 255 else: c : 0 # c ((((i&oxb) O)'((j&OxB»" O»*255; checkimage(ind(i,j,o)] - c checkimage(ind(i,j,l)] - c checkimage(ind(i,j,2)] - c checkimage(ind(i,j,3)] - 255
57 - - def init(): glclearcolor (1.0, 0.0, 0.0, 0.0) glshademodel(gl FLAT) glenable(gl_depth_test) makecheckimage (checkimageheight, checkimagewidth) print checkimage[o:-l] glpixelstorei(gl UNPACK ALIGNMENT, 1) - - glgentextures(l, texname); glbindtexture(gl TEXTURE 2D, texname[o]); gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_S, GL_CLAMP) gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_T, GL_CLAMP) gltexparameteri(gl_texture_2d, GL_TEXTURE_MAG_FILTER, GL_NEAREST) gltexparameteri(gl_texture_2d, GL_TEXTURE_MIN_FILTER, GL_NEAREST) glteximage2d(gl_texture_2d, 0, GL_RGBA, checkimagewidth, checkimageheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, checkimage) print "OK"
58 I def display(): glclear(gl_color_buffer_bit I GL_DEPTH_BUFFER_BIT) glenable(gl_texture_2d) gltexenv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL DECAL) glbindtexture(gl_texture_2d, texname[o]); print glistexture(texname[o])==gl_true glbegin(gl QUADS) gltexcoord2f(o.o, 0.0); glvertex3f(-2.0, -1.0, 0.0) gltexcoord2f(o.o, 1.0); glvertex3f(-2.0, 1.0, 0.0) gltexcoord2f(1.o, 1.0); glvertex3f(o.o, 1.0, 0.0) gltexcoord2f(1.o, 0.0); glvertex3f(o.o, -1.0, 0.0) gltexcoord2f(o.o, 0.0); glvertex3f(1.o, -1.0, 0.0) gltexcoord2f(o.o, 1.0); glvertex3f(1.o, 1.0, 0.0) gltexcoord2f(1.o, 1.0); glvertex3f( , 1.0, ) gltexcoord2f(1.o, 0.0); glvertex3f( , -1.0, ) glend( ) glflush( ) gldisable(gl_texture_2d)
59 def reshape{w, h): glviewport{o, 0, w, h) glmatrixmode{gl PROJECTION) glloadidentity{) gluperspective{60.0, float{w)/float{h), 1.0, 30.0) glmatrixmode{gl MODELVIEW) glloadidentity{) gltranslatef{o.o, 0.0, -3.6) I def keyboard{key, x, y): if key == chr(27): sys.exit{o) # Main program entry point if name " main ": glutinit{ ) glutinitdisplaymode{glut_single I GLUT RGB I GLUT_DEPTH) glutinitwindowsize{250, 250) glutinitwindowposition{loo, 100) glutcreatewindow{"checker") ini t () glutdisplayfunc{display) glutreshapefunc{reshape) glutkeyboardfunc{keyboard) glutmainloop{ )
60 Textured checkboard
61 Different texture checkimagewidth, checkimageheight = 16, 16
62 Texturing out of space (S, T ) = [0, 1] 2, clamped gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_S, GL_CLAMP) gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_T, GL )
63 Texturing out of space (S, T ) = [0, 1] 2, repeated gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_S, GL_REPEAT) gltexparameteri(gl_texture_2d, GL_TEXTURE_WRAP_T, GL_REPEAT)
64 Contents Textures Introduction Steps in Texture Mapping A Sample Program Texturing algorithms
65 Bounding volume Depending on the mapping situation, we may need to bound an object with a box, a cylinder, or a sphere.
66 Planar texture mapping For a planar map, we take an (x,y,z) value from the object and project one of the components. We use the planar coordinate to look up the color in the texture map.
67 Planar texture mapping? (checker1.py)
Chapter 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 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 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 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 information9.Texture Mapping. Chapter 9. Chapter Objectives
Chapter 9 9.Texture Mapping Chapter Objectives After reading this chapter, you ll be able to do the following: Understand what texture mapping can add to your scene Specify texture images in compressed
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 informationOpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University
OpenGL Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University Background Software interface to graphics hardware 250+ commands Objects (models) are built from geometric primitives
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 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 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 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 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 information1)Write a shader program that renders a regular pentagon with textured image like the one shown below.
Andrew Yenalavitch CSE520 Winter 2015 Quiz 2 Report 1)Write a shader program that renders a regular pentagon with textured image like the one shown below. Use the following provided image for the texture:
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 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 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 informationComputer Graphics Programming
Computer Graphics Programming Graphics APIs Using MFC (Microsoft Foundation Class) in Visual C++ Programming in Visual C++ GLUT in Windows and Unix platform Overview and Application Graphics APIs Provide
More informationQUESTION 1 [10] 2 COS340-A October/November 2009
2 COS340-A QUESTION 1 [10] a) OpenGL uses z-buffering for hidden surface removal. Explain how the z-buffer algorithm works and give one advantage of using this method. (5) Answer: OpenGL uses a hidden-surface
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 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 informationOpenCL / OpenGL Texture Interoperability: An Image Blurring Case Study
1 OpenCL / OpenGL Texture Interoperability: An Image Blurring Case Study Mike Bailey mjb@cs.oregonstate.edu opencl.opengl.rendertexture.pptx OpenCL / OpenGL Texture Interoperability: The Basic Idea 2 Application
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 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 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 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 informationTo Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)
Computer Graphics (Fall 2008) COMS 4160, Lecture 9: OpenGL 1 http://www.cs.columbia.edu/~cs4160 To Do Start thinking (now) about HW 3. Milestones are due soon. Course Course 3D Graphics Pipeline 3D Graphics
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 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 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 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 informationLectures OpenGL Introduction
Lectures OpenGL Introduction By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 What is
More informationTexture Mapping. Texture Mapping. Map textures to surfaces. Trompe L Oeil ( Deceive the Eye ) The texture. Texture map
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
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 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 informationOpenGL. 1 OpenGL OpenGL 1.2 3D. (euske) 1. Client-Server Model OpenGL
OpenGL (euske) 1 OpenGL - 1.1 OpenGL 1. Client-Server Model 2. 3. 1.2 3D OpenGL (Depth-Buffer Algorithm Z-Buffer Algorithm) (polygon ) ( rendering) Client-Server Model X Window System ( GL ) GL (Indy O
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 information1) Here is the various stages of the tetrahedron:
Andrew Yenalavitch Homework 3 CSE 520 - Winter 2015 1) ( 20 points ) Write a shader program that renders a colored tetrahedron, which gradually shrinks to a point and expands back to its original shape.
More informationAssignment #3: Scalar Field Visualization 3D: Cutting Plane, Wireframe Iso-surfacing, and Direct Volume Rendering
Assignment #3: Scalar Field Visualization 3D: Cutting Plane, Wireframe Iso-surfacing, and Direct Volume Rendering Goals: Due October 9 th, before midnight With the results from your assignement#2, the
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 informationPreparing for Texture Access. Stored Texture Shaders. Accessing Texture Maps. Vertex Shader Texture Access
Stored Texture Shaders Preparing for Texture Access These steps are the same when using a shader as when using fixed functionality Make a specific texture unit active by calling glactivetexture Create
More informationStored Texture Shaders
Stored Texture Shaders 157 Preparing for Texture Access These steps are the same when using a shader as when using fixed functionality Make a specific texture unit active by calling glactivetexture Create
More informationTexture Mapping and Special Effects
Texture Mapping and Special Effects February 23 rd 26 th 2007 MAE 410-574, Virtual Reality Applications and Research Instructor: Govindarajan Srimathveeravalli HW#5 Due March 2 nd Implement the complete
More informationIntroduction to OpenGL. Prof. Dr.-Ing. Lars Linsen
Introduction to OpenGL Prof. Dr.-Ing. Lars Linsen School of Engineering and Science Bremen 320621: Advanced Visualization Lab 1. What is OpenGL? Graphics Programming Graphical user interface (GUI) Windowing
More informationLecture 5. Scan Conversion Textures hw2
Lecture 5 Scan Conversion Textures hw2 Announcements Homework deadlines Mini Project Proposals due June 26th E.T. 06 Vector Graphics Algebraic equations describe shapes. Can render type and large areas
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 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 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 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 informationProgramming with OpenGL Part 3: Three Dimensions
Programming with OpenGL Part 3: Three Dimensions Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Objectives Develop a more sophisticated
More informationOpenGL/GLUT Intro. Week 1, Fri Jan 12
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner OpenGL/GLUT Intro Week 1, Fri Jan 12 http://www.ugrad.cs.ubc.ca/~cs314/vjan2007 News Labs start next week Reminder:
More information11494 Interactive and GPU Computing Lab. 6-06/05/2015. Textures
11494 Interactive and GPU Computing Lab. 6-06/05/2015 Supervisor: Abel Gomes Textures Scribe: Orlando Pereira The goal of this assignment is to understand how to use textures inside the OpenGL environment.
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 informationOpenGL. Toolkits.
http://www.opengl.org OpenGL Open Graphics Library Graphics API Delivered with UNIX, Win9x/2000/Me/Nt/Xp, Mac OS Direct3D (DirectX) is only Windows Utilizes the window system and event handling of the
More informationComputer Graphics Texture Mapping
Computer Graphics 2012 13. Texture Mapping Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2012-10-31 有关实验 - 备用 ftp 地址 - 10.214.0.111 - 帐号 :cg2012 - 密码 :2012 - 请按照规定上传到指定目录, 便于管理和检查 - 今日实验签到
More informationIntroduction to OpenGL
CS100433 Introduction to OpenGL Junqiao Zhao 赵君峤 Department of Computer Science and Technology College of Electronics and Information Engineering Tongji University Before OpenGL Let s think what is need
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 informationMost device that are used to produce images are. dots (pixels) to display the image. This includes CRT monitors, LCDs, laser and dot-matrix
Scan Conversion of Lines Raster devices Most device that are used to produce images are raster devices, that is, use rectangular arrays of dots (pixels) to display the image. This includes CRT monitors,
More informationCSC 240 Computer Graphics. Fall 2015 Smith College
CSC 240 Computer Graphics Fall 2015 Smith College Outline: 11/9 Stacks revisited Shading (using normal vectors) Texture Mapping Final quiz If time: robot with two arms White background slides from Eitan
More informationComputer Graphics Course 2005
Computer Graphics Course 2005 Introduction to GLUT, GLU and OpenGL Administrative Stuff Teaching Assistant: Rony Goldenthal Reception Hour: Wed. 18:00 19:00 Room 31 (Ross 1) Questions: E-mail: cg@cs Newsgroups:
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 informationGraphics Programming
Graphics Programming 3 rd Week, 2011 OpenGL API (1) API (application programming interface) Interface between an application program and a graphics system Application Program OpenGL API Graphics Library
More informationTexture Mapping Part 1
Texture Mapping Part 1 The Quest for Visual Realism Why Texture Map? How to do it How to do it right Spilling the beans Assignment #3 Lecture 17 Comp 236 Spring 2005 3/21/2005 Lecture 17 2 Decal Textures
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 informationAssignment #6 2D Vector Field Visualization Arrow Plot and LIC
Assignment #6 2D Vector Field Visualization Arrow Plot and LIC Due Oct.15th before midnight Goal: In this assignment, you will be asked to implement two visualization techniques for 2D steady (time independent)
More informationBob s Concise Introduction to Doxygen
Bob s Concise Introduction to Doxygen by Robert S Laramee Visual and Interactive Computing Group Department of Computer Science Swansea University Swansea, Wales, UK 1 Comment Standard February 14, 2011
More informationOpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL
OpenGL: Open Graphics Library Introduction to OpenGL Part II CS 351-50 Graphics API ( Application Programming Interface) Software library Layer between programmer and graphics hardware (and other software
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 informationto OpenGL Introduction Pipeline Graphics pipeline OpenGL pipeline OpenGL syntax Modeling Arrays Conclusion 1 Introduction Introduction to OpenGL
to to ning Lecture : introduction to Lab : first steps in and - 25/02/2009 Lecture/Lab : transformations and hierarchical - 04/03/2009 to Lecture : lights and materials in - 11/03/2009 Lab : lights and
More informationLecture 3. Understanding of OPenGL programming
Lecture 3 Understanding of OPenGL programming What is OpenGL GL: stands for Graphic Library Software interface for rendering purposes for 2D or 3D geometric data objects. Various Pieces gl: The basic libraries.
More informationTeacher Assistant : Tamir Grossinger Reception hours: by - Building 37 / office -102 Assignments: 4 programing using
Teacher Assistant : Tamir Grossinger email: tamirgr@gmail.com Reception hours: by email - Building 37 / office -102 Assignments: 4 programing using C++ 1 theoretical You can find everything you need in
More informationAnnouncements OpenGL. Computer Graphics. Autumn 2009 CS4815
Computer Graphics Autumn 2009 Outline 1 Labs 2 Labs Outline 1 Labs 2 Labs Labs Week02 lab Marking 8 10 labs in total each lab worth 2 3% of overall grade marked on attendance and completion of lab completed
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 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 informationIntMu.Lab5. Download all the files available from
IntMu.Lab5 0. Download all the files available from http://www.dee.isep.ipp.pt/~jml/intmu/lab5: wget http://www.dee.isep.ipp.pt/~jml/intmu/lab5/makefile make getall Analyze the program windmill.c. Compile
More informationIntroduction to Computer Graphics with OpenGL/GLUT
Introduction to Computer Graphics with OpenGL/GLUT What is OpenGL? A software interface to graphics hardware Graphics rendering API (Low Level) High-quality color images composed of geometric and image
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 informationAnnouncements OpenGL. Computer Graphics. Spring CS4815
Computer Graphics Spring 2017-2018 Outline 1 2 Tutes and Labs Tute02, vector review (see matrix) Week02 lab Lab Marking 10 labs in total each lab worth 3% of overall grade marked on attendance and completion
More informationOpenGL: A Practical Introduction. (thanks, Mark Livingston!)
OpenGL: A Practical Introduction (thanks, Mark Livingston!) Outline What is OpenGL? Auxiliary libraries Basic code structure Rendering Practical hints Virtual world operations OpenGL Definitions Software
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 information