Imam Cholissodin| imam.cholissodin@gmail.com 07 | Texture Mapping Imam Cholissodin| imam.cholissodin@gmail.com.

Slides:



Advertisements
Presentasi serupa
PENGOLAHAN CITRA DIGITAL : Operasi Aritmatik dan Geometri pada Citra
Advertisements

Function.
Learning Medium School : SMPN 1 Gotham City Subject : English
Eriq Muhammad Adams J | 03 |Primitives Eriq Muhammad Adams J |
Imam Cholissodin| 04 |Transformations Imam Cholissodin|
Manajemen Proyek: Overview
K-Map Using different rules and properties in Boolean algebra can simplify Boolean equations May involve many of rules / properties during simplification.
Eriq Muhammad Adams J | 04 |Transformation Eriq Muhammad Adams J |
Imam Cholissodin| 06 | Viewing / Camera Imam Cholissodin|
Class and Object Introduction Specifying a Class Defining Member Function A C++ Program with Class Nesting of Member Functions Private Member Functions.
BLACK BOX TESTING.
Presented By : Group 2. A solution of an equation in two variables of the form. Ax + By = C and Ax + By + C = 0 A and B are not both zero, is an ordered.
The steps to work with Power Point click Start> All Programs> Microsoft Office> Microsoft Office PowerPoint2007 klik Start>All Programs>Microsoft.
CSS 3.
Imam Cholissodin| 12 | Model Loading & Curve Imam Cholissodin|
Fuzzy for Image Processing
1 Pertemuan 21 Function Matakuliah: M0086/Analisis dan Perancangan Sistem Informasi Tahun: 2005 Versi: 5.
1 Pertemuan 5 Komunikasi antar Proses / Interprocess Communication (IPC) Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS01.
1 Pertemuan 11 Function dari System Matakuliah: M0446/Analisa dan Perancangan Sistem Informasi Tahun: 2005 Versi: 0/0.
Imam Cholissodin| 10 | Lighting & Shading Imam Cholissodin|
COMPUTER GRAPHICS D10K-5C01 GK11: OpenGL Transformasi dan Interaksi Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas.
Gunawan. SISTEM PENILAIAN KKomponen Penilaian : AAbsensi (10 %) TTugas/Quis (10 %) UUjian I (mid semester) (40 %) UUjian II (akhir semester)
9.3 Geometric Sequences and Series. Objective To find specified terms and the common ratio in a geometric sequence. To find the partial sum of a geometric.
Visual Basic for Aplications in powerpoint. What is Visual Basic for Aplications? Visual Basic for Applications (VBA) is a very powerful objectoriented.
Grafika Komputer dan Visualisasi Disusun oleh : Silvester Dian Handy Permana, S.T., M.T.I. Fakultas Telematika, Universitas Trilogi Pertemuan 15 : Kurva.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- to-Relational Mapping.
ILIMA FITRI AZMI TEACHING MATERIAL DEVELOPMENT
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
KOMUNIKASI DATA Materi Pertemuan 3.
Induksi Matematika.
GEOMETRI SUDUT DAN BIDANG.
Rekayasa Perangkat Lunak Class Diagram
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Cartesian coordinates in two dimensions
Cartesian coordinates in two dimensions
Kode Hamming.
PENDIDIKAN KARAKTER DALAM MATA PELAJARAN FISIKA SMA
Pengujian Hipotesis (I) Pertemuan 11
Matakuliah : I0014 / Biostatistika Tahun : 2005 Versi : V1 / R1
Pengolahan Citra Digital
CLASS DIAGRAM.
CA113 Pengantar Manajemen Bisnis
Transformasi.
Image Enhancement –Spatial Filtering
02 |Introduction to OpenGL
Algorithms and Programming Searching
Pendugaan Parameter (II) Pertemuan 10
Texture Mapping.
CA113 Pengantar Manajemen Bisnis
TEOREMA PYTHAGORAS This template can be used as a starter file to give updates for project milestones. Sections Right-click on a slide to add sections.
Pertemuan 4 CLASS DIAGRAM.
02 |Introduction to OpenGL
02 |Introduction to OpenGL
How to Set Up AT&T on MS Outlook ATT is a multinational company headquartered in Texas. ATT services are used by many people widely across.
How Can I Be A Driver of The Month as I Am Working for Uber?
Things You Need to Know Before Running on the Beach.
Don’t Forget to Avail the Timely Offers with Uber
Suhandi Wiratama. Before I begin this presentation, I want to thank Mr. Abe first. He taught me many things about CorelDRAW. He also guided me when I.
CA113 Pengantar Manajemen Bisnis
Simultaneous Linear Equations
Algoritma & Pemrograman 1 Achmad Fitro The Power of PowerPoint – thepopp.com Chapter 3.
INTERROGATIVE ADJECTIVE. DEFINITION FUNCTION EXAMPLE QUESTION.
02 |Introduction to OpenGL
Al Muizzuddin F Matematika Ekonomi Lanjutan 2013
Rank Your Ideas The next step is to rank and compare your three high- potential ideas. Rank each one on the three qualities of feasibility, persuasion,
Draw a picture that shows where the knife, fork, spoon, and napkin are placed in a table setting.
2. Discussion TASK 1. WORK IN PAIRS Ask your partner. Then, in turn your friend asks you A. what kinds of product are there? B. why do people want to.
WINTER Template COLOUR CARD 01 Template. PowerPoint chart object 02.
Transcript presentasi:

Imam Cholissodin| imam.cholissodin@gmail.com 07 | Texture Mapping Imam Cholissodin| imam.cholissodin@gmail.com

Texture Mapping : What’s Texture Mapping Texture Representation Map textures to surfaces Texture Mapping Process Texture Value Lookup OpenGL Texture Mapping Specify Textures Fix Texture Size Texture Mapping Parameters Texture Color Blending Demos Program

What’s Texture Mapping Metode yang digunakan untuk menambahkan detail texture pada permukaan objek. Ada 2 cara untuk melakukan Texture Mapping : Membuat extra polygon untuk membangun detail model pada objek. Menambah kompleksitas scene, sehingga memperlambat kecepatan rendering grafis. Bebera fitur grafis akan sulit untuk dimodelkan! Membuat texture map pada permukaan (pendekatan yang lebih sering digunakan) Kompleksitas gambar tidak mempengaruhi kompleksitas pengolahan secara geometri. (transformation, clipping…)

Texture Representation Texture Bitmap (pixel map) (supported by OpenGL) Texture Prosedural (used in advanced rendering programs) Bitmap texture: A 2D image - represented by 2D array texture[height][width] Each pixel (or called texel ) by a unique pair texture coordinate (s, t) The s and t are usually normalized to a [0,1] range For any given (s,t) in the normalized range, there is a unique image value (i.e., a unique [red, green, blue] set ) s t (0,0) (1,1)

Map textures to surfaces Menetapkan mapping dari texture ke permukaaan (polygons): - Program aplikasi yang kita buat perlu untuk menentukan koordinat texture disetiap sudut polygon. (0,0) (1,0) (1,1) Polygon tersebut dapat berukuran sembarang

Map textures to surfaces Pemetaan tekstur dilakukan dengan konsep rasterization/ bitmap (backward mapping) Rasterization : Konversi dari data geometri dan data pixel ke dalam fragment (bentuk array persegi panjang). (1,1) (0,1) Untuk setiap pixel yang akan dirender, tekstur koordinat (s, t) ditentukan (diinterpolasi) berdasarkan koordinat tekstur sudutnya (mengapa tidak hanya menginterpolasi unsur warnanya saja?) Koordinat tekstur yang diinterpolasi kemudian digunakan untuk melakukan pencarian tekstur (texture lookup) yang sesuai untuk diterapkan pada permukaan. (0,0) (1,0)

Texture Mapping Process 1. projection 3. patch texel 3D geometry 2. texture lookup 2D projection of 3D geometry S t 2D image

Texture Value Lookup For the given texture coordinates (s,t), we can find a unique image value from the texture map (1,1) How about coordinates that are not exactly at the intersection (pixel) positions? Nearest neighbor Linear Interpolation Other filters (0,0) (0.25,0) (0.5,0) (0.75,0) (1,0)

OpenGL texture mapping Steps in your program Specify texture read or generate image Assign to texture Specify texture mapping parameters Wrapping, filtering, etc. Enable GL texture mapping (GL_TEXTURE_2D) Assign texture coordinates to vertices Draw your objects Disable GL texture mapping (if you don’t need to perform texture mapping any more)

Specify textures Load the texture map from main memory to texture memory glTexImage2D(Glenum target, Glint level, Glint iformat, int width, int height, int border, Glenum format, Glenum type, Glvoid* img) Example: glTeximage2D(GL_TEXTURE_2D, 0, GL_RGB, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, myImage); (myImage is a 2D array: GLuByte myImage[64][64][3]; ) The dimensions of texture images must be powers of 2

Fix Texture Size If the dimensions of the texture map are not power of 2, you can Pad zeros 2) use gluScaleImage() 60 Ask OpenGL to filter the data for you to the right size – you can specify the output resolution that you want 100 128 Remember to adjust the texture coordinates for your polygon corners – you don’t want to Include black texels in your final picture 64

Texture Mapping Parameters What happen if the given texture coordinates (s,t) are outside [0,1] range? Example: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP) GL_Repeat (0,0) (2,2) (0,0) (2,2) GL_Clamp If (s >1) s = 1 If (t >1) t = 1 (0,0) (1,1) texture

Texture Mapping Parameters(2) Karena poligon bisa ditransformasikan ke dalam ukuran layar sembarang, maka texels di tekstur map bisa diperbesar (magnified) atau diperkecil (minified). Filtering: interpolate a texel value from its neighbors or combine multiple texel values into a single one texture texture polygon projection polygon projection Magnification Minification

Texture Mapping Parameters(3) OpenGL texture filtering: 2) Linear interpolate the neighbors (better quality, slower) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) Nearest Neighbor (lower image quality) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); Or GL_TEXTURE_MAX_FILTER

Texture Color Blending Determine how to combine the texel color and the object color GL_MODULATE – multiply texture and object color GL_BLEND – linear combination of texture and object color GL_REPLACE – use texture color to replace object color Example : glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); Enable (Disable) Textures Enable texture – glEnable(GL_TEXTURE_2D) Disable texture – glDisable(GL_TEXTURE_2D) Note :“Remember to disable texture mapping when you draw non-textured polygons”

Specify Texture Coordinates Give texture coordinates before defining each vertex glBegin(GL_QUADS); glTexCoord2D(0,0); glVertex3f(-0.5, 0, 0.5); … glEnd();

Put It All Together … glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glEnable(GL_TEXTURE_2D); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, mytexture); Draw_picture1(); // define texture coordinates and vertices in the function ….

Imam Cholissodin| imam.cholissodin@gmail.com Selesai Imam Cholissodin| imam.cholissodin@gmail.com