Computer Graphics with Three.JS

Slides:



Advertisements
Similar presentations
Parameterized Environment Maps
Advertisements

Graphics Pipeline.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
GAM532 DPS932 – Week 7 Introduction to shadows. Shadow Effects Light Surface No Shadows Shadows.
An introduction to WebGL Viktor Kovács. Content A little 3D modeling. What is WebGL? Introducing Three.js. Visualizing GDL objects.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
Rendering with Texture Maps CMPS 160 Assignment 5.
Objects in 3D – Parametric Surfaces Computer Graphics Seminar MUM, summer 2005.
OpenGL Texture Mapping
OpenGL Texture Mapping Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
OpenGL Texture Mapping April 16, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Basic Stragegy Three steps to applying a texture.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CS 638, Fall 2001 Today Light Mapping (Continued) Bump Mapping with Multi-Texturing Multi-Pass Rendering.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
3D API By Clayton Azzopardi (Group 10). Introduction Android uses the OpenGL ES 1.0 API Android uses the OpenGL ES 1.0 API Open Graphics Library for Embedded.
Texture Mapping Course: Computer Graphics Presented by Fan Chen
Computer Graphics Ben-Gurion University of the Negev Fall 2012.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
3D Graphics for Game Programming Chapter IV Fragment Processing and Output Merging.
Texture Mapping. 2 Motivation A typical modern graphics card can handle 10s of millions of polygons a second. How many individual blades of grass are.
OpenGL Texture Mapping. 2 Objectives Introduce the OpenGL texture functions and options.
CS 480/680 Computer Graphics OpenGL Texture Mapping Dr. Frederick C Harris, Jr. Fall 2011.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS418 Computer Graphics John C. Hart
1 3D API OPENGL ES v1.0 Owned by Silicon Graphics (SGL) Control was then transferred to Khronos Group Introduction.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Texture Mapping CAP4730: Computational Structures in Computer Graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
OpenGL Graphics Textures. Quiz You didn't see that coming!
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.
Texture Mapping. For Further Reading Angel 7 th Ed: ­Chapter 7: 7.3 ~ 7.9 Beginning WebGL: ­Chapter 3 2.
Module 05 –Bump mapping Module 05 – Bump mapping Module 05 Advanced mapping techniques: Bump mapping.
Textures, Sprites, and Fonts
Week 7 - Monday CS361.
Week 2 - Friday CS361.
The Graphic PipeLine
Basic Rendering Techniques
OpenGL Texture Mapping
OpenGL Texture Mapping
Introduction to Computer Graphics with WebGL
Chapters VIII Image Texturing
Introduction to Computer Graphics with WebGL
© University of Wisconsin, CS559 Fall 2004
Introduction to Texture Mapping
3D Game Programming Texture Mapping
Chapter XIV Normal Mapping
CS-378: Game Technology Lecture #4: Texture and Other Maps
OpenGL Texture Mapping
OpenGL Texture Mapping
Advanced Computer Graphics: Texture
Texture Mapping Ed Angel Professor Emeritus of Computer Science
3D Game Programming Texture Mapping
Texture Mapping Jung Lee.
OpenGL Texture Mapping
Presentation transcript:

Computer Graphics with Three.JS Part II (Texturing)

Texture Mapping A way to render realistic picture w/o using too many polygons Fall 2009 revised Parallax mapping

Texture Coordinate System Texture: a 2D array of color values, each unit is called texel (texture element) Every texture map has (s,t) coordinates [0,0] to [1,1] Each vertex in a polygon specifies its texture coordinates (s,t), then map to the given image to determine the corresponding texture Fall 2009 revised

Example Screen space view Texture Map Texture space view OpenGL code Fall 2009 revised

Example Screen space view Texture space view Texture Map OpenGL code BACK Fall 2009 revised

Texture Mapping in Three.JS Map in material Different texture modulation in different material UV coordinates Settings: wrapping, filters, … multitexture Jsfiddles… (CORS) Spring 2016

Texture Coordinates Spring 2016

Texture Parameters wrapS/T: minFilter magFilter For non power-of-two textures, “simplest” parameters apply wrapS/T: THREE.ClampToEdgeWrapping, THREE.RepeatWrapping, and THREE.MirroredRepeatWrapping How the texture repeats for texcoord outside [0,1] Texture.repeat: a simpler way to set repeat pattern minFilter THREE.LinearMipMapLinearFilter, THREE.NearestFilter, THREE.NearestMipMapNearestFilter, THREE.NearestMipMapLinearFilter, THREE.LinearFilter, and THREE.LinearMipMapNearestFilter. magFilter THREE.LinearFilter, THREE.NearestFilter Spring 2016

Texture Parameters (3JS) Spring 2016

Code Study (site) Spring 2016

Texture Environment (modulate) Spring 2016

Easy Multi-Texture Basically, it is a kind of blending Spring 2016

Code Study (site) Spring 2016

Cutout texture (billboard) Alpha Test material.alphaTest Sets the alphaValue to be used when running an alpha test (default: 0) alphaTest: if alpha > 0, the fragment passes Must set material.transparent = true glAlphaFunc (GL_GREATER, alphaValue) Spring 2016

From Stack Overflow (url) Spring 2016

Spring 2016

Cylindrical Billboard Spring 2016

Code Study (site) Spring 2016

MeshFaceMaterial Is now THREE.MultiMaterial Spring 2016

Example (jsfiddle) var geometry = new THREE.Geometry();   geometry.vertices.push(     new THREE.Vector3(-50, 50, -50),   new THREE.Vector3(-50, -50, -50),     new THREE.Vector3(100, -50, -50),  new THREE.Vector3(50, 50, -50)   );   var face;   face = new THREE.Face3(0, 1, 3);  face.materialIndex = 0;   geometry.faces.push(face);   face = new THREE.Face3(1, 2, 3);  face.materialIndex = 1;   var materialArray = [];   materialArray.push(new THREE.MeshBasicMaterial({     color: 0x009999   }));     color: 0xff0000   var material = new THREE.MeshFaceMaterial(materialArray); var mesh = new THREE.Mesh (geometry, material); Spring 2016