SlideShare a Scribd company logo
Colors and Textures
      Make it pretty
Review
Colors

• glColor - sets the color state
• Linear interpolate along Vertices
• Code time!
Texture Mapping
What?
Texture
 http://www.opengl.org/wiki/Texture



GL_TEXTURE_1D: Images in this texture all are 1-dimensional. They have width, but no height or depth.
GL_TEXTURE_2D: Images in this texture all are 2-dimensional. They have width and height, but no depth.
GL_TEXTURE_3D: Images in this texture all are 3-dimensional. They have width, height, and depth.
GL_TEXTURE_RECTANGLE: The image in this texture (only one image. No mipmapping) is 2-dimensional.
Texture coordinates used for these textures are not normalized.
GL_TEXTURE_BUFFER: The image in this texture (only one image. No mipmapping) is 1-dimensional. The
storage for this data comes from a Buffer Object.
GL_TEXTURE_CUBE_MAP: There are exactly 6 distinct sets of 2D images, all of the same size. They act as 6
faces of a cube.
GL_TEXTURE_1D_ARRAY: Images in this texture all are 1-dimensional. However, it contains multiple sets of
1-dimensional images, all within one texture. The array length is part of the texture's size.
GL_TEXTURE_2D_ARRAY Array: Images in this texture all are 2-dimensional. However, it contains multiple
sets of 2-dimensional images, all within one texture. The array length is part of the texture's size.
Texture
•   GL_TEXTURE_2D: Images in this
    texture all are 2-dimensional. They
    have width and height, but no
    depth.
glTexImage2D


• Creates The Texture from an array of
  bytes and sets the texture “state”
• All subsequent calls are on this texture
GL_TEXTURE_2D


• glEnable(GL_TEXTURE_2D)
• Might want to turn on texturing.
Texture Environment


• glTexEnvi
• Sets various properties on the texture
  state
Filtering
• Textures rarely map 1-1 to geometric
  primitives.
• You can set magnification filters or
  minification filters.
• Linear interpolation or nearest neighbor
• glTexParameter
Texture Wrapping


• When texture coordinates fall outside 0-1
• REPEAT, CLAMP, CLAMP_TO_EDGE,
  CLAMP_TO_BORDER
Code
Mipmapping

• Scintillation
• Performance
• multum in parvo - “many things in a small
  place”
• That level field on the glTexImage call
Lighting


• Let’s look at code
Thanks

More Related Content

PDF
PDF
Qcce quality constrained co saliency estimation for common object detection
PPTX
Ii m sc mathematics probability and statistics
DOCX
Nano Scale Roughness Quantification
PDF
BEM Solution for the Radiation BC Thermal Problem with Adaptive Basis Functions
PDF
Legacy codesmalltalk
PDF
Test Driven Cocos2d
PDF
HTML5 Space Invaders
Qcce quality constrained co saliency estimation for common object detection
Ii m sc mathematics probability and statistics
Nano Scale Roughness Quantification
BEM Solution for the Radiation BC Thermal Problem with Adaptive Basis Functions
Legacy codesmalltalk
Test Driven Cocos2d
HTML5 Space Invaders

Similar to 8thlightu3 (20)

PPT
CS 354 Texture Mapping
PPT
OpenGL Texture Mapping
PDF
OpenGL L05-Texturing
PDF
201707 SER332 Lecture 21
PDF
Texture Mapping
PPTX
Texture mapping in_opengl
PPTX
Opengl texturing
PPT
Topic 6 Graphic Transformation and Viewing.ppt
PDF
6 texture mapping computer graphics
PPTX
GFX Part 4 - Introduction to Texturing in OpenGL ES
PPT
Anatomy of a Texture Fetch
PDF
The Ring programming language version 1.8 book - Part 154 of 202
PPTX
OpenGL Introduction
PDF
GLSL Shading with OpenSceneGraph
PDF
The Ring programming language version 1.5.4 book - Part 113 of 185
PPTX
Opengl presentation
PDF
The Ring programming language version 1.9 book - Part 157 of 210
PDF
The Ring programming language version 1.5.2 book - Part 143 of 181
PDF
The Ring programming language version 1.7 book - Part 177 of 196
PDF
The Ring programming language version 1.8 book - Part 106 of 202
CS 354 Texture Mapping
OpenGL Texture Mapping
OpenGL L05-Texturing
201707 SER332 Lecture 21
Texture Mapping
Texture mapping in_opengl
Opengl texturing
Topic 6 Graphic Transformation and Viewing.ppt
6 texture mapping computer graphics
GFX Part 4 - Introduction to Texturing in OpenGL ES
Anatomy of a Texture Fetch
The Ring programming language version 1.8 book - Part 154 of 202
OpenGL Introduction
GLSL Shading with OpenSceneGraph
The Ring programming language version 1.5.4 book - Part 113 of 185
Opengl presentation
The Ring programming language version 1.9 book - Part 157 of 210
The Ring programming language version 1.5.2 book - Part 143 of 181
The Ring programming language version 1.7 book - Part 177 of 196
The Ring programming language version 1.8 book - Part 106 of 202
Ad

More from Eric Smith (6)

PDF
Web Security 100
PDF
Test driven game development silly, stupid or inspired?
PPT
Tdd in unity
PDF
Html5 episode 2
PDF
SCMC HTML5 Game Development
KEY
8thlightu2
Web Security 100
Test driven game development silly, stupid or inspired?
Tdd in unity
Html5 episode 2
SCMC HTML5 Game Development
8thlightu2
Ad

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
cuic standard and advanced reporting.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Review of recent advances in non-invasive hemoglobin estimation
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
cuic standard and advanced reporting.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Electronic commerce courselecture one. Pdf
NewMind AI Weekly Chronicles - August'25 Week I
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Big Data Technologies - Introduction.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

8thlightu3

  • 1. Colors and Textures Make it pretty
  • 3. Colors • glColor - sets the color state • Linear interpolate along Vertices • Code time!
  • 6. Texture http://www.opengl.org/wiki/Texture GL_TEXTURE_1D: Images in this texture all are 1-dimensional. They have width, but no height or depth. GL_TEXTURE_2D: Images in this texture all are 2-dimensional. They have width and height, but no depth. GL_TEXTURE_3D: Images in this texture all are 3-dimensional. They have width, height, and depth. GL_TEXTURE_RECTANGLE: The image in this texture (only one image. No mipmapping) is 2-dimensional. Texture coordinates used for these textures are not normalized. GL_TEXTURE_BUFFER: The image in this texture (only one image. No mipmapping) is 1-dimensional. The storage for this data comes from a Buffer Object. GL_TEXTURE_CUBE_MAP: There are exactly 6 distinct sets of 2D images, all of the same size. They act as 6 faces of a cube. GL_TEXTURE_1D_ARRAY: Images in this texture all are 1-dimensional. However, it contains multiple sets of 1-dimensional images, all within one texture. The array length is part of the texture's size. GL_TEXTURE_2D_ARRAY Array: Images in this texture all are 2-dimensional. However, it contains multiple sets of 2-dimensional images, all within one texture. The array length is part of the texture's size.
  • 7. Texture • GL_TEXTURE_2D: Images in this texture all are 2-dimensional. They have width and height, but no depth.
  • 8. glTexImage2D • Creates The Texture from an array of bytes and sets the texture “state” • All subsequent calls are on this texture
  • 10. Texture Environment • glTexEnvi • Sets various properties on the texture state
  • 11. Filtering • Textures rarely map 1-1 to geometric primitives. • You can set magnification filters or minification filters. • Linear interpolation or nearest neighbor • glTexParameter
  • 12. Texture Wrapping • When texture coordinates fall outside 0-1 • REPEAT, CLAMP, CLAMP_TO_EDGE, CLAMP_TO_BORDER
  • 13. Code
  • 14. Mipmapping • Scintillation • Performance • multum in parvo - “many things in a small place” • That level field on the glTexImage call

Editor's Notes