SlideShare a Scribd company logo
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

Introduction to graphics programming in c
Introduction to graphics programming in cIntroduction to graphics programming in c
Introduction to graphics programming in c
baabtra.com - No. 1 supplier of quality freshers
 
Games 3 dl4-example
Games 3 dl4-exampleGames 3 dl4-example
Games 3 dl4-example
enrique_arguello
 
C graphics programs file
C graphics programs fileC graphics programs file
C graphics programs file
shubham 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/5
Takao Wada
 
OpenGL L02-Transformations
OpenGL L02-TransformationsOpenGL L02-Transformations
OpenGL L02-Transformations
Mohammad Shaker
 
Tomato Classification using Computer Vision
Tomato Classification using Computer VisionTomato Classification using Computer Vision
Tomato Classification using Computer Vision
Raman Pandey
 
Unity programming 1
Unity programming 1Unity programming 1
Unity programming 1
Petri Lankoski
 
[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8
Picker Weng
 
Bai 1
Bai 1Bai 1
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platform
Jussi 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 Pipeline
Narann29
 
C Graphics Functions
C Graphics FunctionsC Graphics Functions
C Graphics Functions
SHAKOOR AB
 
Deep dive into deeplearn.js
Deep dive into deeplearn.jsDeep dive into deeplearn.js
Deep dive into deeplearn.js
Kai Sasaki
 
Approaching zero driver overhead
Approaching zero driver overheadApproaching zero driver overhead
Approaching zero driver overhead
Cass Everitt
 
Opensource gis development - part 4
Opensource gis development - part 4Opensource gis development - part 4
Opensource gis development - part 4
Andrea 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 196
Mahmoud 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/5
Takao Wada
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
Mark 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

OpenGL L04-Lighting
OpenGL L04-LightingOpenGL L04-Lighting
OpenGL L04-Lighting
Mohammad Shaker
 
OpenGL Starter L02
OpenGL Starter L02OpenGL Starter L02
OpenGL Starter L02
Mohammad Shaker
 
Open GL Tutorial06
Open GL Tutorial06Open GL Tutorial06
Open GL Tutorial06
Roziq Bahtiar
 
OpenGL L06-Performance
OpenGL L06-PerformanceOpenGL L06-Performance
OpenGL L06-Performance
Mohammad Shaker
 
Mesh texturing
Mesh texturingMesh texturing
Mesh texturing
Hyounggap An
 
COMPUTER GRAPHICS DAY1
COMPUTER GRAPHICS DAY1COMPUTER GRAPHICS DAY1
COMPUTER GRAPHICS DAY1
Barnali Gupta Banik
 
OpenGL Starter L01
OpenGL Starter L01OpenGL Starter L01
OpenGL Starter L01
Mohammad Shaker
 
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)
Daroko blog(www.professionalbloggertricks.com)
 
Texturing
TexturingTexturing
Texturing
KeyShot Spain
 
OpenGL L01-Primitives
OpenGL L01-PrimitivesOpenGL L01-Primitives
OpenGL L01-Primitives
Mohammad Shaker
 
3 D Maya Introduction
3 D Maya Introduction3 D Maya Introduction
3 D Maya Introduction
tsshivshankar
 
Intro to maya
Intro to mayaIntro 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
Parvesh Taneja
 
3D Modeling and Texturing Walkthrough
3D Modeling and Texturing Walkthrough3D Modeling and Texturing Walkthrough
3D Modeling and Texturing Walkthrough
Martin Reimer
 
Introduction to 3D Modelling
Introduction to 3D ModellingIntroduction to 3D Modelling
Introduction to 3D Modelling
Cosimo Orban
 
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]
Mohammad Shaker
 
Tour of Vue.js
Tour of Vue.jsTour of Vue.js
Tour of Vue.js
선협 이
 

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

Texture Mapping
Texture Mapping Texture Mapping
Texture Mapping
Budditha Hettige
 
OpenGL Texture Mapping
OpenGL Texture MappingOpenGL Texture Mapping
OpenGL Texture Mapping
Syed Zaid Irshad
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture Mapping
Mark Kilgard
 
Texture mapping in_opengl
Texture mapping in_openglTexture mapping in_opengl
Texture mapping in_opengl
Manas Nayak
 
Multi graph encoder
Multi graph encoderMulti graph encoder
Multi graph encoder
Yajie Zhou
 
Opengl texturing
Opengl texturingOpengl texturing
Opengl texturing
Sardar Alam
 
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
Eric Smith
 
Demystifying Neural Style Transfer
Demystifying Neural Style TransferDemystifying Neural Style Transfer
Demystifying Neural Style Transfer
SEMINARGROOT
 
Cj36511514
Cj36511514Cj36511514
Cj36511514
IJERA Editor
 
Arkanoid Game
Arkanoid GameArkanoid Game
Arkanoid Game
graphitech
 
201707 SER332 Lecture 21
201707 SER332 Lecture 21   201707 SER332 Lecture 21
201707 SER332 Lecture 21
Javier Gonzalez-Sanchez
 
Render to Texture with Three.js
Render to Texture with Three.jsRender to Texture with Three.js
Render to Texture with Three.js
Prabindh Sundareson
 
Computer Vision.pptx
Computer Vision.pptxComputer Vision.pptx
Computer Vision.pptx
GDSCIIITDHARWAD
 
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
Prabindh 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
 
A0280105
A0280105A0280105
A0280105
researchinventy
 
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
FITC
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORT
vineet 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 Learning
alihassaah1994
 

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 Graduate
Mohammad Shaker
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with Psychology
Mohammad Shaker
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015
Mohammad Shaker
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game Development
Mohammad Shaker
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and Wearables
Mohammad Shaker
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - Color
Mohammad Shaker
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - Typography
Mohammad Shaker
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and Coupling
Mohammad Shaker
 
Android L05 - Storage
Android L05 - StorageAndroid L05 - Storage
Android L05 - Storage
Mohammad Shaker
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and Threading
Mohammad Shaker
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOS
Mohammad Shaker
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile Constraints
Mohammad Shaker
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and Grids
Mohammad Shaker
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and Gaming
Mohammad Shaker
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / Parse
Mohammad Shaker
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
Mohammad 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 Adapters
Mohammad Shaker
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
Mohammad Shaker
 
Indie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieIndie Series 03: Becoming an Indie
Indie Series 03: Becoming an Indie
Mohammad 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

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
AnkitaPandya11
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 

Recently uploaded (20)

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 

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