SlideShare a Scribd company logo
1 of 69
Download to read offline
Mohammad Shaker
mohammadshaker.com
@ZGTRShaker
2015
OpenGL Graphics
L05-Texturing
Texturing
that appears in a video game needs to be textured; this includes everything from plants
to people. If things aren’t textured well, your game just won’t look right.
OpenGL Architecture
Display
List
Polynomial
Evaluator
Per Vertex
Operations &
Primitive
Assembly
Rasterization
Per Fragment
Operations
Frame
Buffer
Texture
Memory
CPU
Pixel
Operations
OpenGL Architecture
Display
List
Polynomial
Evaluator
Per Vertex
Operations &
Primitive
Assembly
Rasterization
Per Fragment
Operations
Frame
Buffer
Texture
Memory
CPU
Pixel
Operations
How to use a Texture?
• How to use a Texture?
1. Load the texture
2. Map it into a polygon
3. Draw the polygon
How to use a Texture?
• How to use a Texture?
1. Load the texture
2. Map it into a polygon
3. Draw the polygon
• How to use a Texture? (OpenGL)
1. Specify textures in texture objects
2. Set texture filter
3. Set texture function
4. Set texture wrap mode
5. Set optional perspective correction hint
6. Bind texture object
7. Enable texturing
8. Supply texture coordinates for vertex
• How OpenGL store images?
– One image per texture object
– May be shared by several graphics contexts
Textures Coordinates
Textures Coordinates
Texture Mapping
s
t
x
y
z
image
geometry
screen
Textures Coordinates
Textures Coordinates
Textures Coordinates
s
t
1, 10, 1
0, 0 1, 0
(s, t) = (0.2, 0.8)
(0.4, 0.2)
(0.8, 0.4)
A
B C
a
b
c
Texture Space Object Space
Texturing Example
Texturing Code
GLvoid DrawGLScene()
//Set camera and projection
GLvoid init()
Global scope:
Texturing Code
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, imageTexId);
glScalef(5,5,1);
glBegin(GL_QUADS);
glTexCoord2f(1,0) ; glVertex3f(1,-1,1);
glTexCoord2f(1,1) ; glVertex3f(1,1,1);
glTexCoord2f(0,1) ; glVertex3f(-1,1,1);
glTexCoord2f(0,0) ; glVertex3f(-1,-1,1);
glEnd();
glDisable(GL_TEXTURE_2D);
GLvoid DrawGLScene()
//Set camera and projection
imageTexId = LoadTexture("images//tile.bmp");
GLvoid init()
#include "texture.h”
int imageTexId;
Global scope:
Texturing Code
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, imageTexId);
glScalef(5,5,1);
glBegin(GL_QUADS);
glTexCoord2f(1,0) ; glVertex3f(1,-1,1);
glTexCoord2f(1,1) ; glVertex3f(1,1,1);
glTexCoord2f(0,1) ; glVertex3f(-1,1,1);
glTexCoord2f(0,0) ; glVertex3f(-1,-1,1);
glEnd();
glDisable(GL_TEXTURE_2D);
GLvoid DrawGLScene()
//Set camera and projection
imageTexId = LoadTexture("images//tile.bmp");
GLvoid init()
#include "texture.h”
int imageTexId;
Global scope:
Texturing Code
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, imageTexId);
glScalef(5,5,1);
glBegin(GL_QUADS);
glTexCoord2f(1,0) ; glVertex3f(1,-1,1);
glTexCoord2f(1,1) ; glVertex3f(1,1,1);
glTexCoord2f(0,1) ; glVertex3f(-1,1,1);
glTexCoord2f(0,0) ; glVertex3f(-1,-1,1);
glEnd();
glDisable(GL_TEXTURE_2D);
GLvoid DrawGLScene()
//Set camera and projection
imageTexId = LoadTexture("images//tile.bmp");
GLvoid init()
#include "texture.h”
int imageTexId;
Global scope:
Texturing Code
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, imageTexId);
glScalef(5,5,1);
glBegin(GL_QUADS);
glTexCoord2f(1,0) ; glVertex3f(1,-1,1);
glTexCoord2f(1,1) ; glVertex3f(1,1,1);
glTexCoord2f(0,1) ; glVertex3f(-1,1,1);
glTexCoord2f(0,0) ; glVertex3f(-1,-1,1);
glEnd();
glDisable(GL_TEXTURE_2D);
GLvoid DrawGLScene()
//Set camera and projection
imageTexId = LoadTexture("images//tile.bmp");
GLvoid init()
#include "texture.h”
int imageTexId;
Global scope:
Texturing Functions
Texturing Functions
• Generate texture names
glGenTextures(n, *texIds);
• Create texture objects with texture data and state
glBindTexture(target, id);
• Bind textures before using
glBindTexture(target, id);
• Define a texture image from an array of texels in CPU memory
glTexImage2D(target, level, components, w, h, border, format, type,
*texels);
• Texel colors are processed by pixel pipeline
– pixel scales, biases and lookups can be done
Filter Modes
• Filter modes control how pixels are minified or magnified. Generally a color is
computed using the nearest texel or by a linear average of several texels.
• The filter type, above is one of GL_TEXTURE_MIN_FILTER or GL_TEXTURE_MAG_FILTER.
• The mode is one of GL_NEAREST, GL_LINEAR, or special modes for mipmapping.
Mipmapping modes are used for minification only, and have values of:
– GL_NEAREST_MIPMAP_NEAREST
– GL_NEAREST_MIPMAP_LINEAR
– GL_LINEAR_MIPMAP_NEAREST
– GL_LINEAR_MIPMAP_LINEAR
Filter Modes
• Example: glTexParameteri(target, type, mode);
Texture Polygon
Magnification Minification
PolygonTexture
Wrapping Mode
• Wrap mode determines what should happen if a texture coordinate lies outside of the [0,1] range.
• If the GL_REPEAT wrap mode is used, for texture coordinate values less than zero or greater than
one, the integer is ignored and only the fractional value is used.
• If the GL_CLAMP wrap mode is used, the texture value at the extreme (either 0 or 1) is used.
• Example:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
texture
GL_REPEAT
wrapping
GL_CLAMP
wrapping
s
t
Texture Parameters
Read more: https://open.gl/textures
Body Color When Textured
• glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
– resultColor = Body Color + Texture Color [By default]
• glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
– resultColor = Texture Color
• glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND);
– resultColor = Texture Color + Blending
• GLfloat fColor[4] = { 0.0f, 0.0f, 0.0f, 1f };
• glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, fColor);
Texturing
Something to pay attention for
Something to pay attention for
• The image must be 24 bit (RGB)
• The image extension should be .bmp
• The image dimensions must be a power of 2 (2, 4, 8, 16, 32, 64, ..etc.)
– If dimensions of image are not power of 2 then scale:
• gluScaleImage(format, w_in, h_in, type_in, *data_in, w_out, h_out,
type_out, *data_out);
*_in is for source image
*_out is for destination image
• White color should be assigned before drawing a textured object by setting:
glColor3f(1,1,1);
• You should call: glBindTexture(GL_TEXTURE_2D, textureID) between glBegin() and
glEnd()
gluQuadricTexture
Textures Coordinates
gluQuadricTexture
+
gluQuadricTexture
+ =
gluQuadricTexture
Blending
Blending
• You can blend objects using:
– glBlendFunc(GLenum sfactor, GLenum dfactor);
• sfactor: is the source blend factor
• dfactor: is the destination blend factor
• Transparency is implemented using:
– “GL_SRC_ALPHA” for the source
– “GL_ONE_MINUS_SRC_ALPHA” for the destination
Blending
• You can blend objects using:
– glBlendFunc(GLenum sfactor, GLenum dfactor);
• sfactor: is the source blend factor
• dfactor: is the destination blend factor
• Transparency is implemented using:
– “GL_SRC_ALPHA” for the source
– “GL_ONE_MINUS_SRC_ALPHA” for the destination
OpenGL Architecture
Display
List
Polynomial
Evaluator
Per Vertex
Operations &
Primitive
Assembly
Rasterization
Per Fragment
Operations
Frame
Buffer
Texture
Memory
CPU
Pixel
Operations
OpenGL Architecture
Display
List
Polynomial
Evaluator
Per Vertex
Operations &
Primitive
Assembly
Rasterization
Per Fragment
Operations
Frame
Buffer
Texture
Memory
CPU
Pixel
Operations
Blending
• Combine pixels with what’s in already in the framebuffer
glBlendFunc(src, dst )
Framebuffer
Pixel (dst)
Blending
Equation
Fragment
(src)
Blended
Pixel
pfr CdstCsrcC


Transparency with .tga (32 bit)
Transparency with .tga
+ =
Transparency with .tga
+ =
One .tga File
Transparency with .tga Code
GLvoid DrawGLScene()
//Set camera and projection
GLvoid init()
Global scope:
Transparency with .tga Code
glBindTexture(GL_TEXTURE_2D , grassImage.texID);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_QUADS);
glTexCoord2f(1,0); glVertex3f(5,-5,0);
glTexCoord2f(1,1); glVertex3f(5,5,0);
glTexCoord2f(0,1); glVertex3f(-5,5,0);
glTexCoord2f(0,0); glVertex3f(-5,-5,0);
glEnd();
glDisable(GL_BLEND);
GLvoid DrawGLScene()
//Set camera and projection
glEnable(GL_TEXTURE_2D);
grassImage = LoadTGA(“images//grass.tga");
GLvoid init()
#include "tgaLoader.h”
TGAImage grassImage;
Global scope:
Transparency with .tga Code
glBindTexture(GL_TEXTURE_2D , grassImage.texID);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_QUADS);
glTexCoord2f(1,0); glVertex3f(5,-5,0);
glTexCoord2f(1,1); glVertex3f(5,5,0);
glTexCoord2f(0,1); glVertex3f(-5,5,0);
glTexCoord2f(0,0); glVertex3f(-5,-5,0);
glEnd();
glDisable(GL_BLEND);
GLvoid DrawGLScene()
//Set camera and projection
glEnable(GL_TEXTURE_2D);
grassImage = LoadTGA(“images//grass.tga");
GLvoid init()
#include "tgaLoader.h”
TGAImage grassImage;
Global scope:
Transparency with .tga Code
glBindTexture(GL_TEXTURE_2D , grassImage.texID);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_QUADS);
glTexCoord2f(1,0); glVertex3f(5,-5,0);
glTexCoord2f(1,1); glVertex3f(5,5,0);
glTexCoord2f(0,1); glVertex3f(-5,5,0);
glTexCoord2f(0,0); glVertex3f(-5,-5,0);
glEnd();
glDisable(GL_BLEND);
GLvoid DrawGLScene()
//Set camera and projection
glEnable(GL_TEXTURE_2D);
grassImage = LoadTGA(“images//grass.tga");
GLvoid init()
#include "tgaLoader.h”
TGAImage grassImage;
Global scope:
Transparency with .tga Code
glBindTexture(GL_TEXTURE_2D , grassImage.texID);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_QUADS);
glTexCoord2f(1,0); glVertex3f(5,-5,0);
glTexCoord2f(1,1); glVertex3f(5,5,0);
glTexCoord2f(0,1); glVertex3f(-5,5,0);
glTexCoord2f(0,0); glVertex3f(-5,-5,0);
glEnd();
glDisable(GL_BLEND);
GLvoid DrawGLScene()
//Set camera and projection
glEnable(GL_TEXTURE_2D);
grassImage = LoadTGA(“images//grass.tga");
GLvoid init()
#include "tgaLoader.h”
TGAImage grassImage;
Global scope:
Transparency with .tga Code
glBindTexture(GL_TEXTURE_2D , grassImage.texID);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_QUADS);
glTexCoord2f(1,0); glVertex3f(5,-5,0);
glTexCoord2f(1,1); glVertex3f(5,5,0);
glTexCoord2f(0,1); glVertex3f(-5,5,0);
glTexCoord2f(0,0); glVertex3f(-5,-5,0);
glEnd();
glDisable(GL_BLEND);
GLvoid DrawGLScene()
//Set camera and projection
glEnable(GL_TEXTURE_2D);
grassImage = LoadTGA(“images//grass.tga");
GLvoid init()
#include "tgaLoader.h”
TGAImage grassImage;
Global scope:
Transparency with .tga Code / Fixes
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D , grassImage.texID);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_QUADS);
glTexCoord2f(1,0); glVertex3f(5,-5,0);
glTexCoord2f(1,1); glVertex3f(5,5,0);
glTexCoord2f(0,1); glVertex3f(-5,5,0);
glTexCoord2f(0,0); glVertex3f(-5,-5,0);
glEnd();
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
GLvoid DrawGLScene()
//Set camera and projection
grassImage = LoadTGA(“images//grass.tga");
GLvoid init()
#include "tgaLoader.h”
TGAImage grassImage;
Global scope:
Transparency with .tga Code / Fixes
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D , grassImage.texID);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA);
glPushMatrix();
glLoadIdentity();
glScalef(5, 5, 1);
glBegin(GL_QUADS);
glTexCoord2f(1,0); glVertex3f(1,-1,0);
glTexCoord2f(1,1); glVertex3f(1,1,0);
glTexCoord2f(0,1); glVertex3f(-1,1,0);
glTexCoord2f(0,0); glVertex3f(-1,-1,0);
glEnd();
glPopMatrix();
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
GLvoid DrawGLScene()
//Set camera and projection
grassImage = LoadTGA(“images//grass.tga");
GLvoid init()
#include "tgaLoader.h”
TGAImage grassImage;
Global scope:
Transparency with .tga
Add Transparency with .tga
Transparency with .tga (32 bit)
Something to pay attention for, again
Something to pay attention for, again
• The image must be 24 bit (RGB)
• The image extension should be .bmp
• The image dimensions must be a power of 2 (2, 4, 8, 16, 32, 64, ..etc.) or scale.
• White color should be assigned before drawing a textured object by setting:
glColor3f(1,1,1);
• You should call: glBindTexture(GL_TEXTURE_2D, textureID) between
glBegin() and glEnd()
• Additional stuff when you use transparency with .tga
– The image must be 32 bit (RGB)
– The image extension should be .tga
– In InitGL(), You must load .tga files LAST
– In DrawGLScene(), you must draw the transparent objects LAST
Texture Tilling
Texture Tilling
Tiling is a very simple effect that creates a repeating pattern of
an image on the surface of a primitive object
Texture Tilling
Using a small image to cover a large surface makes tiling a useful way to increase the
performance of your textures and decrease the size of your image files.
Texture Tilling, How to
Simply set the texture coordinates larger than 1
as many time as you want the texture to be tilled
Billboarding
Billboarding
Mipmapping
Mipmapping
multum in parvo (mip): many things in a small place
Mipmapped Textures
• Mipmap allows for prefiltered texture maps of decreasing resolutions
• Lessens interpolation errors for smaller textured objects
• Declare mipmap level during texture definition
glTexImage*D(GL_TEXTURE_*D, level, …)
• GLU mipmap builder routines
gluBuild*DMipmaps()
2D Texture and 3D Texture?
http://gamedev.stackexchange.com/questions/9668/what-are-3d-textures
2D Texture and 3D Texture
• All we have used so far are 2D textures mapped on a 3D coordinates.
• So what’s a 3D texture?!
– 3D texture (or sometimes called “Volume textures”) works like regular 2D texture but it is truly
3D. 2D textures has UV coordinates, 3D has UVW coordinates
Textures Coordinates
• Texture coordinates are named s, t, r, and q
2D Texture and 3D Texture
• 3D textures are used in:
– Textures mapped into a model vertices
– volumetric effects in games (fire, smoke, light rays, realistic fog)
– caching light for realtime global illumination (CryEngine for example)
– scientific (MRI, CT scans are saved into volumes)
2D Texture and 3D Texture
• Watch Nvidia smoke box in a XFX 9600gt
– https://www.youtube.com/watch?v=9AS4xV-CK14
2D Texture and 3D Texture
• Watch Global illumination in CryEngine 3 Tech Trailer (HD)
– https://www.youtube.com/watch?v=Pq39Xb7OdH8

More Related Content

What's hot

C graphics programs file
C graphics programs fileC graphics programs file
C graphics programs fileshubham kanojia
 
Trident International Graphics Workshop 2014 5/5
Trident International Graphics Workshop 2014 5/5Trident International Graphics Workshop 2014 5/5
Trident International Graphics Workshop 2014 5/5Takao Wada
 
OpenGL L02-Transformations
OpenGL L02-TransformationsOpenGL L02-Transformations
OpenGL L02-TransformationsMohammad Shaker
 
Tomato Classification using Computer Vision
Tomato Classification using Computer VisionTomato Classification using Computer Vision
Tomato Classification using Computer VisionRaman Pandey
 
[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8Picker Weng
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platformJussi Pohjolainen
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)JAINAM KAPADIYA
 
Advanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineAdvanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineNarann29
 
C Graphics Functions
C Graphics FunctionsC Graphics Functions
C Graphics FunctionsSHAKOOR AB
 
Deep dive into deeplearn.js
Deep dive into deeplearn.jsDeep dive into deeplearn.js
Deep dive into deeplearn.jsKai Sasaki
 
Approaching zero driver overhead
Approaching zero driver overheadApproaching zero driver overhead
Approaching zero driver overheadCass Everitt
 
Opensource gis development - part 4
Opensource gis development - part 4Opensource gis development - part 4
Opensource gis development - part 4Andrea Antonello
 
The Ring programming language version 1.7 book - Part 63 of 196
The Ring programming language version 1.7 book - Part 63 of 196The Ring programming language version 1.7 book - Part 63 of 196
The Ring programming language version 1.7 book - Part 63 of 196Mahmoud Samir Fayed
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Takao Wada
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing StuffMark Kilgard
 
openFrameworks 007 - GL
openFrameworks 007 - GL openFrameworks 007 - GL
openFrameworks 007 - GL roxlu
 

What's hot (20)

Introduction to graphics programming in c
Introduction to graphics programming in cIntroduction to graphics programming in c
Introduction to graphics programming in c
 
Games 3 dl4-example
Games 3 dl4-exampleGames 3 dl4-example
Games 3 dl4-example
 
C graphics programs file
C graphics programs fileC graphics programs file
C graphics programs file
 
Trident International Graphics Workshop 2014 5/5
Trident International Graphics Workshop 2014 5/5Trident International Graphics Workshop 2014 5/5
Trident International Graphics Workshop 2014 5/5
 
OpenGL L02-Transformations
OpenGL L02-TransformationsOpenGL L02-Transformations
OpenGL L02-Transformations
 
Tomato Classification using Computer Vision
Tomato Classification using Computer VisionTomato Classification using Computer Vision
Tomato Classification using Computer Vision
 
Unity programming 1
Unity programming 1Unity programming 1
Unity programming 1
 
[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8
 
Bai 1
Bai 1Bai 1
Bai 1
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platform
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)
 
Advanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineAdvanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering Pipeline
 
C Graphics Functions
C Graphics FunctionsC Graphics Functions
C Graphics Functions
 
Deep dive into deeplearn.js
Deep dive into deeplearn.jsDeep dive into deeplearn.js
Deep dive into deeplearn.js
 
Approaching zero driver overhead
Approaching zero driver overheadApproaching zero driver overhead
Approaching zero driver overhead
 
Opensource gis development - part 4
Opensource gis development - part 4Opensource gis development - part 4
Opensource gis development - part 4
 
The Ring programming language version 1.7 book - Part 63 of 196
The Ring programming language version 1.7 book - Part 63 of 196The Ring programming language version 1.7 book - Part 63 of 196
The Ring programming language version 1.7 book - Part 63 of 196
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
 
openFrameworks 007 - GL
openFrameworks 007 - GL openFrameworks 007 - GL
openFrameworks 007 - GL
 

Viewers also liked

Viewers also liked (18)

OpenGL L04-Lighting
OpenGL L04-LightingOpenGL L04-Lighting
OpenGL L04-Lighting
 
OpenGL Starter L02
OpenGL Starter L02OpenGL Starter L02
OpenGL Starter L02
 
Open GL Tutorial09
Open GL Tutorial09Open GL Tutorial09
Open GL Tutorial09
 
Open GL Tutorial06
Open GL Tutorial06Open GL Tutorial06
Open GL Tutorial06
 
OpenGL L06-Performance
OpenGL L06-PerformanceOpenGL L06-Performance
OpenGL L06-Performance
 
Mesh texturing
Mesh texturingMesh texturing
Mesh texturing
 
COMPUTER GRAPHICS DAY1
COMPUTER GRAPHICS DAY1COMPUTER GRAPHICS DAY1
COMPUTER GRAPHICS DAY1
 
OpenGL Starter L01
OpenGL Starter L01OpenGL Starter L01
OpenGL Starter L01
 
lecture3 color representation in computer graphics(Computer graphics tutorials)
lecture3 color representation in computer graphics(Computer graphics tutorials)lecture3 color representation in computer graphics(Computer graphics tutorials)
lecture3 color representation in computer graphics(Computer graphics tutorials)
 
Texturing
TexturingTexturing
Texturing
 
OpenGL L01-Primitives
OpenGL L01-PrimitivesOpenGL L01-Primitives
OpenGL L01-Primitives
 
3 D Maya Introduction
3 D Maya Introduction3 D Maya Introduction
3 D Maya Introduction
 
Intro to maya
Intro to mayaIntro to maya
Intro to maya
 
3D modelling and animation using Autodesk maya
3D modelling and animation using Autodesk maya3D modelling and animation using Autodesk maya
3D modelling and animation using Autodesk maya
 
3D Modeling and Texturing Walkthrough
3D Modeling and Texturing Walkthrough3D Modeling and Texturing Walkthrough
3D Modeling and Texturing Walkthrough
 
Introduction to 3D Modelling
Introduction to 3D ModellingIntroduction to 3D Modelling
Introduction to 3D Modelling
 
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
 
Tour of Vue.js
Tour of Vue.jsTour of Vue.js
Tour of Vue.js
 

Similar to OpenGL L05-Texturing

CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture MappingMark Kilgard
 
Texture mapping in_opengl
Texture mapping in_openglTexture mapping in_opengl
Texture mapping in_openglManas Nayak
 
Multi graph encoder
Multi graph encoderMulti graph encoder
Multi graph encoderYajie Zhou
 
Opengl texturing
Opengl texturingOpengl texturing
Opengl texturingSardar Alam
 
Efficacy of deferred rendering in WebGL
Efficacy of deferred rendering in WebGLEfficacy of deferred rendering in WebGL
Efficacy of deferred rendering in WebGL翔 石井
 
Demystifying Neural Style Transfer
Demystifying Neural Style TransferDemystifying Neural Style Transfer
Demystifying Neural Style TransferSEMINARGROOT
 
GFX Part 4 - Introduction to Texturing in OpenGL ES
GFX Part 4 - Introduction to Texturing in OpenGL ESGFX Part 4 - Introduction to Texturing in OpenGL ES
GFX Part 4 - Introduction to Texturing in OpenGL ESPrabindh Sundareson
 
Using CNTK's Python Interface for Deep LearningDave DeBarr -
Using CNTK's Python Interface for Deep LearningDave DeBarr - Using CNTK's Python Interface for Deep LearningDave DeBarr -
Using CNTK's Python Interface for Deep LearningDave DeBarr - PyData
 
From Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGLFrom Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGLFITC
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTvineet raj
 
Convolutional Neural Network (CNN)of Deep Learning
Convolutional Neural Network (CNN)of Deep LearningConvolutional Neural Network (CNN)of Deep Learning
Convolutional Neural Network (CNN)of Deep Learningalihassaah1994
 

Similar to OpenGL L05-Texturing (20)

Texture Mapping
Texture Mapping Texture Mapping
Texture Mapping
 
OpenGL Texture Mapping
OpenGL Texture MappingOpenGL Texture Mapping
OpenGL Texture Mapping
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture Mapping
 
Texture mapping in_opengl
Texture mapping in_openglTexture mapping in_opengl
Texture mapping in_opengl
 
Multi graph encoder
Multi graph encoderMulti graph encoder
Multi graph encoder
 
Opengl texturing
Opengl texturingOpengl texturing
Opengl texturing
 
Efficacy of deferred rendering in WebGL
Efficacy of deferred rendering in WebGLEfficacy of deferred rendering in WebGL
Efficacy of deferred rendering in WebGL
 
8thlightu3
8thlightu38thlightu3
8thlightu3
 
Demystifying Neural Style Transfer
Demystifying Neural Style TransferDemystifying Neural Style Transfer
Demystifying Neural Style Transfer
 
Cj36511514
Cj36511514Cj36511514
Cj36511514
 
Arkanoid Game
Arkanoid GameArkanoid Game
Arkanoid Game
 
201707 SER332 Lecture 21
201707 SER332 Lecture 21   201707 SER332 Lecture 21
201707 SER332 Lecture 21
 
Render to Texture with Three.js
Render to Texture with Three.jsRender to Texture with Three.js
Render to Texture with Three.js
 
Computer Vision.pptx
Computer Vision.pptxComputer Vision.pptx
Computer Vision.pptx
 
GFX Part 4 - Introduction to Texturing in OpenGL ES
GFX Part 4 - Introduction to Texturing in OpenGL ESGFX Part 4 - Introduction to Texturing in OpenGL ES
GFX Part 4 - Introduction to Texturing in OpenGL ES
 
Using CNTK's Python Interface for Deep LearningDave DeBarr -
Using CNTK's Python Interface for Deep LearningDave DeBarr - Using CNTK's Python Interface for Deep LearningDave DeBarr -
Using CNTK's Python Interface for Deep LearningDave DeBarr -
 
A0280105
A0280105A0280105
A0280105
 
From Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGLFrom Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGL
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORT
 
Convolutional Neural Network (CNN)of Deep Learning
Convolutional Neural Network (CNN)of Deep LearningConvolutional Neural Network (CNN)of Deep Learning
Convolutional Neural Network (CNN)of Deep Learning
 

More from Mohammad Shaker

12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian GraduateMohammad Shaker
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyMohammad Shaker
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015Mohammad Shaker
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game DevelopmentMohammad Shaker
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesMohammad Shaker
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - ColorMohammad Shaker
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - TypographyMohammad Shaker
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingMohammad Shaker
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and ThreadingMohammad Shaker
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSMohammad Shaker
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsMohammad Shaker
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsMohammad Shaker
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and GamingMohammad Shaker
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / ParseMohammad Shaker
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesMohammad Shaker
 
Android L03 - Styles and Themes
Android L03 - Styles and Themes Android L03 - Styles and Themes
Android L03 - Styles and Themes Mohammad Shaker
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and AdaptersMohammad Shaker
 
Indie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieIndie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieMohammad Shaker
 

More from Mohammad Shaker (20)

12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with Psychology
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game Development
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and Wearables
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - Color
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - Typography
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and Coupling
 
Android L05 - Storage
Android L05 - StorageAndroid L05 - Storage
Android L05 - Storage
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and Threading
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOS
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile Constraints
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and Grids
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and Gaming
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / Parse
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
 
Android L03 - Styles and Themes
Android L03 - Styles and Themes Android L03 - Styles and Themes
Android L03 - Styles and Themes
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and Adapters
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
 
Indie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieIndie Series 03: Becoming an Indie
Indie Series 03: Becoming an Indie
 

Recently uploaded

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationShrmpro
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 

Recently uploaded (20)

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

OpenGL L05-Texturing

  • 3. that appears in a video game needs to be textured; this includes everything from plants to people. If things aren’t textured well, your game just won’t look right.
  • 4. OpenGL Architecture Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Frame Buffer Texture Memory CPU Pixel Operations
  • 5. OpenGL Architecture Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Frame Buffer Texture Memory CPU Pixel Operations
  • 6. How to use a Texture? • How to use a Texture? 1. Load the texture 2. Map it into a polygon 3. Draw the polygon
  • 7. How to use a Texture? • How to use a Texture? 1. Load the texture 2. Map it into a polygon 3. Draw the polygon • How to use a Texture? (OpenGL) 1. Specify textures in texture objects 2. Set texture filter 3. Set texture function 4. Set texture wrap mode 5. Set optional perspective correction hint 6. Bind texture object 7. Enable texturing 8. Supply texture coordinates for vertex • How OpenGL store images? – One image per texture object – May be shared by several graphics contexts
  • 13. Textures Coordinates s t 1, 10, 1 0, 0 1, 0 (s, t) = (0.2, 0.8) (0.4, 0.2) (0.8, 0.4) A B C a b c Texture Space Object Space
  • 15. Texturing Code GLvoid DrawGLScene() //Set camera and projection GLvoid init() Global scope:
  • 16. Texturing Code glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, imageTexId); glScalef(5,5,1); glBegin(GL_QUADS); glTexCoord2f(1,0) ; glVertex3f(1,-1,1); glTexCoord2f(1,1) ; glVertex3f(1,1,1); glTexCoord2f(0,1) ; glVertex3f(-1,1,1); glTexCoord2f(0,0) ; glVertex3f(-1,-1,1); glEnd(); glDisable(GL_TEXTURE_2D); GLvoid DrawGLScene() //Set camera and projection imageTexId = LoadTexture("images//tile.bmp"); GLvoid init() #include "texture.h” int imageTexId; Global scope:
  • 17. Texturing Code glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, imageTexId); glScalef(5,5,1); glBegin(GL_QUADS); glTexCoord2f(1,0) ; glVertex3f(1,-1,1); glTexCoord2f(1,1) ; glVertex3f(1,1,1); glTexCoord2f(0,1) ; glVertex3f(-1,1,1); glTexCoord2f(0,0) ; glVertex3f(-1,-1,1); glEnd(); glDisable(GL_TEXTURE_2D); GLvoid DrawGLScene() //Set camera and projection imageTexId = LoadTexture("images//tile.bmp"); GLvoid init() #include "texture.h” int imageTexId; Global scope:
  • 18. Texturing Code glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, imageTexId); glScalef(5,5,1); glBegin(GL_QUADS); glTexCoord2f(1,0) ; glVertex3f(1,-1,1); glTexCoord2f(1,1) ; glVertex3f(1,1,1); glTexCoord2f(0,1) ; glVertex3f(-1,1,1); glTexCoord2f(0,0) ; glVertex3f(-1,-1,1); glEnd(); glDisable(GL_TEXTURE_2D); GLvoid DrawGLScene() //Set camera and projection imageTexId = LoadTexture("images//tile.bmp"); GLvoid init() #include "texture.h” int imageTexId; Global scope:
  • 19. Texturing Code glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, imageTexId); glScalef(5,5,1); glBegin(GL_QUADS); glTexCoord2f(1,0) ; glVertex3f(1,-1,1); glTexCoord2f(1,1) ; glVertex3f(1,1,1); glTexCoord2f(0,1) ; glVertex3f(-1,1,1); glTexCoord2f(0,0) ; glVertex3f(-1,-1,1); glEnd(); glDisable(GL_TEXTURE_2D); GLvoid DrawGLScene() //Set camera and projection imageTexId = LoadTexture("images//tile.bmp"); GLvoid init() #include "texture.h” int imageTexId; Global scope:
  • 21. Texturing Functions • Generate texture names glGenTextures(n, *texIds); • Create texture objects with texture data and state glBindTexture(target, id); • Bind textures before using glBindTexture(target, id); • Define a texture image from an array of texels in CPU memory glTexImage2D(target, level, components, w, h, border, format, type, *texels); • Texel colors are processed by pixel pipeline – pixel scales, biases and lookups can be done
  • 22. Filter Modes • Filter modes control how pixels are minified or magnified. Generally a color is computed using the nearest texel or by a linear average of several texels. • The filter type, above is one of GL_TEXTURE_MIN_FILTER or GL_TEXTURE_MAG_FILTER. • The mode is one of GL_NEAREST, GL_LINEAR, or special modes for mipmapping. Mipmapping modes are used for minification only, and have values of: – GL_NEAREST_MIPMAP_NEAREST – GL_NEAREST_MIPMAP_LINEAR – GL_LINEAR_MIPMAP_NEAREST – GL_LINEAR_MIPMAP_LINEAR
  • 23. Filter Modes • Example: glTexParameteri(target, type, mode); Texture Polygon Magnification Minification PolygonTexture
  • 24. Wrapping Mode • Wrap mode determines what should happen if a texture coordinate lies outside of the [0,1] range. • If the GL_REPEAT wrap mode is used, for texture coordinate values less than zero or greater than one, the integer is ignored and only the fractional value is used. • If the GL_CLAMP wrap mode is used, the texture value at the extreme (either 0 or 1) is used. • Example: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT) texture GL_REPEAT wrapping GL_CLAMP wrapping s t
  • 25. Texture Parameters Read more: https://open.gl/textures
  • 26. Body Color When Textured • glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); – resultColor = Body Color + Texture Color [By default] • glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); – resultColor = Texture Color • glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND); – resultColor = Texture Color + Blending • GLfloat fColor[4] = { 0.0f, 0.0f, 0.0f, 1f }; • glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, fColor);
  • 27. Texturing Something to pay attention for
  • 28. Something to pay attention for • The image must be 24 bit (RGB) • The image extension should be .bmp • The image dimensions must be a power of 2 (2, 4, 8, 16, 32, 64, ..etc.) – If dimensions of image are not power of 2 then scale: • gluScaleImage(format, w_in, h_in, type_in, *data_in, w_out, h_out, type_out, *data_out); *_in is for source image *_out is for destination image • White color should be assigned before drawing a textured object by setting: glColor3f(1,1,1); • You should call: glBindTexture(GL_TEXTURE_2D, textureID) between glBegin() and glEnd()
  • 35. Blending • You can blend objects using: – glBlendFunc(GLenum sfactor, GLenum dfactor); • sfactor: is the source blend factor • dfactor: is the destination blend factor • Transparency is implemented using: – “GL_SRC_ALPHA” for the source – “GL_ONE_MINUS_SRC_ALPHA” for the destination
  • 36. Blending • You can blend objects using: – glBlendFunc(GLenum sfactor, GLenum dfactor); • sfactor: is the source blend factor • dfactor: is the destination blend factor • Transparency is implemented using: – “GL_SRC_ALPHA” for the source – “GL_ONE_MINUS_SRC_ALPHA” for the destination
  • 37. OpenGL Architecture Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Frame Buffer Texture Memory CPU Pixel Operations
  • 38. OpenGL Architecture Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Frame Buffer Texture Memory CPU Pixel Operations
  • 39. Blending • Combine pixels with what’s in already in the framebuffer glBlendFunc(src, dst ) Framebuffer Pixel (dst) Blending Equation Fragment (src) Blended Pixel pfr CdstCsrcC  
  • 42. Transparency with .tga + = One .tga File
  • 43. Transparency with .tga Code GLvoid DrawGLScene() //Set camera and projection GLvoid init() Global scope:
  • 44. Transparency with .tga Code glBindTexture(GL_TEXTURE_2D , grassImage.texID); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_QUADS); glTexCoord2f(1,0); glVertex3f(5,-5,0); glTexCoord2f(1,1); glVertex3f(5,5,0); glTexCoord2f(0,1); glVertex3f(-5,5,0); glTexCoord2f(0,0); glVertex3f(-5,-5,0); glEnd(); glDisable(GL_BLEND); GLvoid DrawGLScene() //Set camera and projection glEnable(GL_TEXTURE_2D); grassImage = LoadTGA(“images//grass.tga"); GLvoid init() #include "tgaLoader.h” TGAImage grassImage; Global scope:
  • 45. Transparency with .tga Code glBindTexture(GL_TEXTURE_2D , grassImage.texID); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_QUADS); glTexCoord2f(1,0); glVertex3f(5,-5,0); glTexCoord2f(1,1); glVertex3f(5,5,0); glTexCoord2f(0,1); glVertex3f(-5,5,0); glTexCoord2f(0,0); glVertex3f(-5,-5,0); glEnd(); glDisable(GL_BLEND); GLvoid DrawGLScene() //Set camera and projection glEnable(GL_TEXTURE_2D); grassImage = LoadTGA(“images//grass.tga"); GLvoid init() #include "tgaLoader.h” TGAImage grassImage; Global scope:
  • 46. Transparency with .tga Code glBindTexture(GL_TEXTURE_2D , grassImage.texID); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_QUADS); glTexCoord2f(1,0); glVertex3f(5,-5,0); glTexCoord2f(1,1); glVertex3f(5,5,0); glTexCoord2f(0,1); glVertex3f(-5,5,0); glTexCoord2f(0,0); glVertex3f(-5,-5,0); glEnd(); glDisable(GL_BLEND); GLvoid DrawGLScene() //Set camera and projection glEnable(GL_TEXTURE_2D); grassImage = LoadTGA(“images//grass.tga"); GLvoid init() #include "tgaLoader.h” TGAImage grassImage; Global scope:
  • 47. Transparency with .tga Code glBindTexture(GL_TEXTURE_2D , grassImage.texID); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_QUADS); glTexCoord2f(1,0); glVertex3f(5,-5,0); glTexCoord2f(1,1); glVertex3f(5,5,0); glTexCoord2f(0,1); glVertex3f(-5,5,0); glTexCoord2f(0,0); glVertex3f(-5,-5,0); glEnd(); glDisable(GL_BLEND); GLvoid DrawGLScene() //Set camera and projection glEnable(GL_TEXTURE_2D); grassImage = LoadTGA(“images//grass.tga"); GLvoid init() #include "tgaLoader.h” TGAImage grassImage; Global scope:
  • 48. Transparency with .tga Code glBindTexture(GL_TEXTURE_2D , grassImage.texID); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_QUADS); glTexCoord2f(1,0); glVertex3f(5,-5,0); glTexCoord2f(1,1); glVertex3f(5,5,0); glTexCoord2f(0,1); glVertex3f(-5,5,0); glTexCoord2f(0,0); glVertex3f(-5,-5,0); glEnd(); glDisable(GL_BLEND); GLvoid DrawGLScene() //Set camera and projection glEnable(GL_TEXTURE_2D); grassImage = LoadTGA(“images//grass.tga"); GLvoid init() #include "tgaLoader.h” TGAImage grassImage; Global scope:
  • 49. Transparency with .tga Code / Fixes glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D , grassImage.texID); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_QUADS); glTexCoord2f(1,0); glVertex3f(5,-5,0); glTexCoord2f(1,1); glVertex3f(5,5,0); glTexCoord2f(0,1); glVertex3f(-5,5,0); glTexCoord2f(0,0); glVertex3f(-5,-5,0); glEnd(); glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); GLvoid DrawGLScene() //Set camera and projection grassImage = LoadTGA(“images//grass.tga"); GLvoid init() #include "tgaLoader.h” TGAImage grassImage; Global scope:
  • 50. Transparency with .tga Code / Fixes glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D , grassImage.texID); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA); glPushMatrix(); glLoadIdentity(); glScalef(5, 5, 1); glBegin(GL_QUADS); glTexCoord2f(1,0); glVertex3f(1,-1,0); glTexCoord2f(1,1); glVertex3f(1,1,0); glTexCoord2f(0,1); glVertex3f(-1,1,0); glTexCoord2f(0,0); glVertex3f(-1,-1,0); glEnd(); glPopMatrix(); glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); GLvoid DrawGLScene() //Set camera and projection grassImage = LoadTGA(“images//grass.tga"); GLvoid init() #include "tgaLoader.h” TGAImage grassImage; Global scope:
  • 53. Transparency with .tga (32 bit) Something to pay attention for, again
  • 54. Something to pay attention for, again • The image must be 24 bit (RGB) • The image extension should be .bmp • The image dimensions must be a power of 2 (2, 4, 8, 16, 32, 64, ..etc.) or scale. • White color should be assigned before drawing a textured object by setting: glColor3f(1,1,1); • You should call: glBindTexture(GL_TEXTURE_2D, textureID) between glBegin() and glEnd() • Additional stuff when you use transparency with .tga – The image must be 32 bit (RGB) – The image extension should be .tga – In InitGL(), You must load .tga files LAST – In DrawGLScene(), you must draw the transparent objects LAST
  • 56. Texture Tilling Tiling is a very simple effect that creates a repeating pattern of an image on the surface of a primitive object
  • 57. Texture Tilling Using a small image to cover a large surface makes tiling a useful way to increase the performance of your textures and decrease the size of your image files.
  • 58. Texture Tilling, How to Simply set the texture coordinates larger than 1 as many time as you want the texture to be tilled
  • 62. Mipmapping multum in parvo (mip): many things in a small place
  • 63. Mipmapped Textures • Mipmap allows for prefiltered texture maps of decreasing resolutions • Lessens interpolation errors for smaller textured objects • Declare mipmap level during texture definition glTexImage*D(GL_TEXTURE_*D, level, …) • GLU mipmap builder routines gluBuild*DMipmaps()
  • 64. 2D Texture and 3D Texture? http://gamedev.stackexchange.com/questions/9668/what-are-3d-textures
  • 65. 2D Texture and 3D Texture • All we have used so far are 2D textures mapped on a 3D coordinates. • So what’s a 3D texture?! – 3D texture (or sometimes called “Volume textures”) works like regular 2D texture but it is truly 3D. 2D textures has UV coordinates, 3D has UVW coordinates
  • 66. Textures Coordinates • Texture coordinates are named s, t, r, and q
  • 67. 2D Texture and 3D Texture • 3D textures are used in: – Textures mapped into a model vertices – volumetric effects in games (fire, smoke, light rays, realistic fog) – caching light for realtime global illumination (CryEngine for example) – scientific (MRI, CT scans are saved into volumes)
  • 68. 2D Texture and 3D Texture • Watch Nvidia smoke box in a XFX 9600gt – https://www.youtube.com/watch?v=9AS4xV-CK14
  • 69. 2D Texture and 3D Texture • Watch Global illumination in CryEngine 3 Tech Trailer (HD) – https://www.youtube.com/watch?v=Pq39Xb7OdH8