University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Textures III Week 10,

Slides:



Advertisements
Similar presentations
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Advertisements

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.
Ted Adelson’s checkerboard illusion. Motion illusion, rotating snakes.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Texture Mapping. Typical application: mapping images on geometry 3D geometry (quads mesh) + RGB texture 2D (color-map) =
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Computer Graphics Bing-Yu Chen National Taiwan University.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 6, 2014 TEXTURE MAPPING TEXTURES BUMP MAPPING ENVIRONMENT MAPPING PROCEDURAL TEXTURING.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures I Week 8, Mon.
Textures, Procedural Approaches, Sampling Week 4, Thu Jun 2
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures III, Procedural.
1Notes  Textbook: matchmove 6.7.2, B.9. 2 Match Move  For combining CG effects with real footage, need to match synthetic camera to real camera: “matchmove”
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Textures I Week 9, Wed.
Chapter 9: Recursive Methods and Fractals E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.
Particle Systems and Fuzzy Shapes Presented by Dan Cogswell.
Texture Mapping CPSC /24/03 Abhijeet Ghosh.
Procedural Modeling L-Systems Procedural Terrain Procedural Behavior Based on the slides from Spring 2007.
Introduction to Volume Visualization Mengxia Zhu Fall 2007.
Texture Mapping from Watt, Ch. 8 Jonathan Han. Topics Discussed Texture Map to Models Bump Maps, Light Maps Environment (Reflection) Mapping 3D Textures.
Course Website: Computer Graphics 11: 3D Object Representations – Octrees & Fractals.
Texturing, Clipping Week 9, Mon 27 Oct 2003
Texture mapping. Adds realism to computer graphics Texture mapping applies a pattern of color Bump mapping alters the surface Mapping is cheaper than.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.
1cs426-winter-2008 Notes. 2 Velocity fields  Velocity field could be a combination of pre-designed velocity elements E.g. explosions, vortices, …  Or.
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 Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Noise Based Texture Noise Based Texture CMPS260 Presentation Guoping Xu Mar. 05, 2003.
3D Computer Graphics: Textures. Textures: texels Texture is a way of assigning a diffuse color to a pixel – can be with 1, 2 or 3D- can use maps, interpolation.
Advanced Texturing Methods Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 8, 2003.
1 Texture. 2 Overview Introduction Painted textures Bump mapping Environment mapping Three-dimensional textures Functional textures Antialiasing textures.
Noise and Procedural Techniques John Spitzer Simon Green NVIDIA Corporation.
4/15/04© University of Wisconsin, CS559 Spring 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Texture Mapping Applications 2. Parallax Mapping with Slope  parallax mapping assumes that the surface is a single plane  a better approximation  surface.
Particle Systems – Technique for Modeling a Class of Fuzzy Objects Craig Schroeder Computer Graphics I April 22, 2004.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
CSC505 Particle Systems. CSC505 Object Representations So far we have represented (rendered) objects with –Lines –Polygons (triangles) –Curves These techniques.
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Procedural Approaches.
Vector Graphics Digital Multimedia Chap 이병희
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Procedural Approaches.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Textures II Week 9, Fri.
Representation and modelling 3 – landscape specialisations 4.1 Introduction 4.2 Simple height field landscapes 4.3 Procedural modeling of landscapes- fractals.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Procedural II, Collision.
OpenGL Graphics Textures. Quiz You didn't see that coming!
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Textures III, Procedural.
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.
第三课. Overview of this Section Concept of Texture Mapping ( 纹理映射 ) 2D Texture 3D Texture Environment Mapping Bump Mapping Others OpenGL Implementation.
An Image Synthesizer- Perlin Noise. Outline Noise Introduction Noise Algorithm Noise Texture Example.
CPSC 314 TEXTURE MAPPING UGRAD.CS.UBC.CA/~cs314 Glen Berseth (Based of Mikhail Bessmeltsev and Dinesh Pai)

Game Design, Development, and Technology
Procedural, Collision University of British Columbia
Volumetric Texture Mapping
Textures II Week 10, Mon Mar 22
Procedural Approaches Curves Week 12, Fri 21 Nov 2003
Particle Systems - A Technique for Modeling a Class of Fuzzy Objects
Advanced Computer Graphics: Texture
Texture Mapping Jung Lee.
Presentation transcript:

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Textures III Week 10, Wed Mar 24

2 News signup sheet for P3 grading Mon/today/Fri signups in class or send to dingkai AT cs by 48 hours after the due date or you'll lose marks (P4 went out Monday)

3 Review: Basic OpenGL Texturing setup generate identifier: glGenTextures load image data: glTexImage2D set texture parameters (tile/clamp/...): glTexParameteri set texture drawing mode (modulate/replace/...): glTexEnvf drawing enable: glEnable bind specific texture: glBindTexture specify texture coordinates before each vertex: glTexCoord2f

4 Review: Reconstruction how to deal with: pixels that are much larger than texels? apply filtering, “averaging” pixels that are much smaller than texels ? interpolate

5 Review: MIPmapping image pyramid, precompute averaged versions Without MIP-mapping With MIP-mapping

6 Texture Parameters in addition to color can control other material/object properties surface normal (bump mapping) reflected color (environment mapping)

7 Bump Mapping: Normals As Texture object surface often not smooth – to recreate correctly need complex geometry model can control shape “effect” by locally perturbing surface normal random perturbation directional change over region

8 Bump Mapping

9

10 Embossing at transitions rotate point’s surface normal by θ or - θ

11 Displacement Mapping bump mapping gets silhouettes wrong shadows wrong too change surface geometry instead only recently available with realtime graphics need to subdivide surface

12 Environment Mapping cheap way to achieve reflective effect generate image of surrounding map to object as texture

13 Environment Mapping used to model object that reflects surrounding textures to the eye movie example: cyborg in Terminator 2 different approaches sphere, cube most popular OpenGL support GL_SPHERE_MAP, GL_CUBE_MAP others possible too

14 Sphere Mapping texture is distorted fish-eye view point camera at mirrored sphere spherical texture mapping creates texture coordinates that correctly index into this texture map

15 Cube Mapping 6 planar textures, sides of cube point camera in 6 different directions, facing out from origin

16 Cube Mapping A B C E F D

17 Cube Mapping direction of reflection vector r selects the face of the cube to be indexed co-ordinate with largest magnitude e.g., the vector (-0.2, 0.5, -0.84) selects the –Z face remaining two coordinates (normalized by the 3 rd coordinate) selects the pixel from the face. e.g., (-0.2, 0.5) gets mapped to (0.38, 0.80). difficulty in interpolating across faces

18 Volumetric Texture define texture pattern over 3D domain - 3D space containing the object texture function can be digitized or procedural for each point on object compute texture from point location in space common for natural material/irregular textures (stone, wood,etc…)

19 Volumetric Bump Mapping Marble Bump

20 Volumetric Texture Principles 3D function   x,y,z) texture space – 3D space that holds the texture (discrete or continuous) rendering: for each rendered point P(x,y,z) compute   x,y,z) volumetric texture mapping function/space transformed with objects

21 Procedural Approaches

22 Procedural Textures generate “image” on the fly, instead of loading from disk often saves space allows arbitrary level of detail

23 Procedural Texture Effects: Bombing randomly drop bombs of various shapes, sizes and orientation into texture space (store data in table) for point P search table and determine if inside shape if so, color by shape otherwise, color by objects color

24 Procedural Texture Effects simple marble function boring_marble(point) x = point.x; return marble_color(sin(x)); // marble_color maps scalars to colors

25 Perlin Noise: Procedural Textures several good explanations FCG Section

26 Perlin Noise: Coherency smooth not abrupt changes coherent white noise

27 Perlin Noise: Turbulence multiple feature sizes add scaled copies of noise

28 Perlin Noise: Turbulence multiple feature sizes add scaled copies of noise

29 Perlin Noise: Turbulence multiple feature sizes add scaled copies of noise function turbulence(p) t = 0; scale = 1; while (scale > pixelsize) { t += abs(Noise(p/scale)*scale); scale/=2; } return t;

30 Generating Coherent Noise just three main ideas nice interpolation use vector offsets to make grid irregular optimization sneaky use of 1D arrays instead of 2D/3D one

31 Interpolating Textures nearest neighbor bilinear hermite

32 Vector Offsets From Grid weighted average of gradients random unit vectors

33 Optimization save memory and time conceptually: 2D or 3D grid populate with random number generator actually: precompute two 1D arrays of size n (typical size 256) random unit vectors permutation of integers 0 to n-1 lookup g(i, j, k) = G[ ( i + P[ (j + P[k]) mod n ] ) mod n ]

34 Perlin Marble use turbulence, which in turn uses noise: function marble(point) x = point.x + turbulence(point); return marble_color(sin(x))

35 Procedural Modeling textures, geometry nonprocedural: explicitly stored in memory procedural approach compute something on the fly often less memory cost visual richness fractals, particle systems, noise

36 Fractal Landscapes fractals: not just for “showing math” triangle subdivision vertex displacement recursive until termination condition

37 Self-Similarity infinite nesting of structure on all scales

38 Fractal Dimension D = log(N)/log(r) N = measure, r = subdivision scale Hausdorff dimension: noninteger D = log(N)/log(r) D = log(4)/log(3) = 1.26 coastline of Britain Koch snowflake

39 Language-Based Generation L-Systems: after Lindenmayer Koch snowflake: F :- FLFRRFLF F: forward, R: right, L: left Mariano’s Bush: F=FF-[-F+F+F]+[+F-F-F] } angle 16

40 1D: Midpoint Displacement divide in half randomly displace scale variance by half

41 2D: Diamond-Square fractal terrain with diamond-square approach generate a new value at midpoint average corner values + random displacement scale variance by half each time

42 Particle Systems loosely defined modeling, or rendering, or animation key criteria collection of particles random element controls attributes position, velocity (speed and direction), color, lifetime, age, shape, size, transparency predefined stochastic limits: bounds, variance, type of distribution

43 Particle System Examples objects changing fluidly over time fire, steam, smoke, water objects fluid in form grass, hair, dust physical processes waterfalls, fireworks, explosions group dynamics: behavioral birds/bats flock, fish school, human crowd, dinosaur/elephant stampede

44 Particle Systems Demos general particle systems boids: bird-like objects

45 Particle Life Cycle generation randomly within “fuzzy” location initial attribute values: random or fixed dynamics attributes of each particle may vary over time color darker as particle cools off after explosion can also depend on other attributes position: previous particle position + velocity + time death age and lifetime for each particle (in frames) or if out of bounds, too dark to see, etc

46 Particle System Rendering expensive to render thousands of particles simplify: avoid hidden surface calculations each particle has small graphical primitive (blob) pixel color: sum of all particles mapping to it some effects easy temporal anti-aliasing (motion blur) normally expensive: supersampling over time position, velocity known for each particle just render as streak

47 Procedural Approaches Summary Perlin noise fractals L-systems particle systems not at all a complete list! big subject: entire classes on this alone