OpenGL. Textures  Bind Textures similar to binding VBO’s  Create a texture for each object  Generate the texture similar how you generate a VBO buffer.

Slides:



Advertisements
Similar presentations
TEXTURE MAPPING JEFF CHASTINE 1. TEXTURE MAPPING Applying an image (or a texture ) to geometry 2D images (rectangular) 3D images (volumetric – such as.
Advertisements

OpenGL Texture Mapping
GAM531 DPS931 – Week 12 Textures and Samplers.
 The success of GL lead to OpenGL (1992), a platform-independent API that was  Easy to use  Close enough to the hardware to get excellent performance.
As well as colors, normals, and other vertex data PUSHIN’ GEO TO THE GPU JEFF CHASTINE 1.
MAT 594CM S2010Fundamentals of Spatial ComputingAngus Forbes Overview Today: - Make sure everyone is set up with an OpenGL environment - OpenGL basics:
Rendering with Texture Maps CMPS 160 Assignment 5.
Computer Graphics Ben-Gurion University of the Negev Fall 2012.
Environmental Maps Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Environmental Mapping CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
1 Lecture 12 Texture Mapping uploading of the texture to the video memory the application of the texture onto geometry.
CS 4731: Computer Graphics Lecture 17: Texturing Emmanuel Agu.
Open Graphics Library (OpenGL)
Texturing in OpenGL Lab #7. Creating Textures glEnable ( GL_TEXTURE_2D ); GLuint myTex; glGenTextures ( 1, (GLuint*) &myTex ); glBindTexture ( GL_TEXTURE_2D,
Texture Mapping. To add surface details… World of Warcraft, Blizzard Inc. More polygons (slow and hard to handle small details) Less polygons but with.
Computer Graphics Texture Mapping Eriq Muhammad Adams
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Texturing A picture is worth a thousand words. Texturing Texturing is the art of doing this with any picture to any model.  (This is Opus the Penguin.
Texture Mapping Course: Computer Graphics Presented by Fan Chen
Computer Graphics Ben-Gurion University of the Negev Fall 2012.
ECSE-4750 Computer Graphics Fall 2004 Prof. Michael Wozny TA. Abhishek Gattani TA. Stephen
Interactive Computer Graphics CS 418 – Spring 2015 Mesh Rendering, Transformation, Camera Viewing and Projection in OpenGL TA: Zhicheng Yan Sushma S Kini.
CS 480/680 Intro Dr. Frederick C Harris, Jr. Fall 2014.
CG1 Labs Wei Li. Back Face Culling // enable back-face culling glEnable( GL_CULL_FACE ); // orientation of front-facing polygons glFrontFace( GL_CCW );
CS 480/680 Computer Graphics OpenGL Texture Mapping Dr. Frederick C Harris, Jr. Fall 2011.
Texture Mapping in OpenGL. Texture Mapping Imaging we are “pasting” a picture onto a model  Which part of the picture will be pasted onto which part.
OpenGL Buffer Transfers Patrick Cozzi University of Pennsylvania CIS Spring 2012.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
OPENGL INTRODUCTION 林宏祥 2014/10/06. 此投影片已被稍微簡化過,跟今日課堂上的內容不太一樣。 如果想要看更詳細說明的人,請參考每頁投影片下面的『備忘稿』
TEXTURES & OTHER GOODIES Computer Graphics. glTexCoord2f(...); + =
OpenGL Shader Language Vertex and Fragment Shading Programs.
1 3D API OPENGL ES v1.0 Owned by Silicon Graphics (SGL) Control was then transferred to Khronos Group Introduction.
CH8 Frame Buffer Object 1. Introduction Name OpenGL :Frame Buffer Object DirectX:Render Target Usage Render to Texture 2.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
OpenGL Programming Guide : Texture Mapping Yoo jin wook Korea Univ. Computer Graphics Lab.
OpenGL Shading Language (GLSL)
OpenGL Graphics Textures. Quiz You didn't see that coming!
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor.
The OpenGL API Patrick Cozzi University of Pennsylvania CIS Fall 2012.
1 Graphics CSCI 343, Fall 2015 Lecture 25 Texture Mapping.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Details of Texture Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 1, 2003.
MP3 Frequently Asked Questions (IN OFFICE HOURS).
Texture Mapping. For Further Reading Angel 7 th Ed: ­Chapter 7: 7.3 ~ 7.9 Beginning WebGL: ­Chapter 3 2.
MP3.. Start at the very beginning. Almost. Either start from nothing yourself, or use the empty template for this MP. Run through the provided files are.
Viewing and Texture Mapping In OPENGL. VIEWING 1.One or more objects 2.A viewer with a projection surface 3.Projectors that go from the object(s) to.
Texture Mapping CEng 477 Introduction to Computer Graphics.
CS 480/680 Computer Graphics Programming with Open GL Part 2: Complete Programs Dr. Frederick C Harris, Jr. Fall 2011.
Pushin’ Geo to the GPU As well as colors, normals, and other vertex data Made by Jeff Chastine, Modified by Chao Mei Jeff Chastine.
Real-Time Rendering Buffers in OpenGL 3.3
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Introduction to OpenGL
OpenGL ARB Superbuffers
OpenGL Texture Mapping
Introduction to Computer Graphics with WebGL
Assignment 3b Q&A.
Assignment 3 Particle System
Introduction to Computer Graphics with WebGL
Geb Thomas Adapted from the OpenGL Programming Guide
Class 26 more textures environmental textures Color ramps
Programming with OpenGL Part 2: Complete Programs
OpenGL Texture Mapping
Programming with OpenGL Part 2: Complete Programs
Class 27 more textures environmental textures Color ramps
Introduction to OpenGL
Programming Textures Lecture 15 Fri, Sep 28, 2007.
CS 480/680 (Fall 2018) Part 2: Texture Loading
OpenGL-Rendering Pipeline
Opengl implementation
Presentation transcript:

OpenGL

Textures  Bind Textures similar to binding VBO’s  Create a texture for each object  Generate the texture similar how you generate a VBO buffer GLuint text glGenTextures(1, &text)

Update Vertex Struct  struct Vertex  {  GLfloat position[3];  GLfloat uv[2];  };

Prepare Shader  Glint texAttrib = glGetAttribLocation(shaderProgram, “texcoord”);  glEnableVertexAttribArray(texAttrib);  glVertexAttribPointer(texAttrib, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),(void*)offsetOf(Vertex,uv))

Assimp Textures  When looping through each face for it’s vertices you will need to check the mesh for texture coordinates. mesh->HasTextureCoords(0) aiVector3D textureCoord = mesh- >mTextureCoords[0][face.mIndices[k]] vert.uv[0] = textureCoord.x; vert.uv[1] = textureCoord.y

Bind Texture To Image  Set Active Texture for Shader glActiveTexture(GL_TEXTURE0)  Binding glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, imgWidth, imgHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, image ) “image” is an array of pixels you obtain from your image loader

Image Libraries  ImageMagick++  FreeImagePlus  Many more…  Specify which one you used in your readme!

References  Provides information on shaders which you will need