Procedural Textures.

Slides:



Advertisements
Similar presentations
Procedural Textures. Noise in glman  glman automatically creates 2D and 3D textures (with default sizes 64x64 and 64x64x64) named  Noise2  Noise3 
Advertisements

Shading CMSC 435/634. RenderMan Light Displacement Surface Volume Imager.
Procedural Textures Jian Huang, CS594, Fall 2002 This set of slides references slides used at Ohio State and “Texturing and modeling” by Ebert, et. al.
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 6, 2014 TEXTURE MAPPING TEXTURES BUMP MAPPING ENVIRONMENT MAPPING PROCEDURAL TEXTURING.
Informationsteknologi Wednesday, December 12, 2007Computer Graphics - Class 171 Today’s class OpenGL Shading Language.
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 12 Solid Textures Bump Mapping Environment Mapping.
GLSL I May 28, 2007 (Adapted from Ed Angel’s lecture slides)
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
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.
Twelve painting with procedures. Overview Making shaded images with procedures Making a more elegant language Making textures with noise functions.
Texture mapping. Adds realism to computer graphics Texture mapping applies a pattern of color Bump mapping alters the surface Mapping is cheaper than.
Eighteen painting with procedures. Review [bitmap-from-procedure procedure width height] Returns a bitmap width pixels by height pixels Obtains colors.
Mohan Sridharan Based on slides created by Edward Angel GLSL I 1 CS4395: Computer Graphics.
Guilford County Sci Vis V204.01
Image Processing.  a typical image is simply a 2D array of color or gray values  i.e., a texture  image processing takes as input an image and outputs.
Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses combinations of sin( px ) and cos( px ) where p is.
David Runyon Lauren Stana Kelsey Vaughn Molly Shelestak.
Noise Based Texture Noise Based Texture CMPS260 Presentation Guoping Xu Mar. 05, 2003.
Computing & Information Sciences Kansas State University Advanced CG 1 of 8: TexturingCIS 636/736: (Introduction to) Computer Graphics CIS 736 Computer.
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.
Interactive Terrain Synthesis
CSS 522 Topics in Rendering March 01,2011 Scott and Lew.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
Noise and Procedural Techniques John Spitzer Simon Green NVIDIA Corporation.
A Non-Photorealistic Fragment Shader in OpenGL 2.0 Bert Freudenberg Institut für Simulation und Graphik University of Magdeburg, Germany.
Texture Mapping Applications 2. Parallax Mapping with Slope  parallax mapping assumes that the surface is a single plane  a better approximation  surface.
Shading CMSC 435/634. RenderMan Light Displacement Surface Volume Imager.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Shading CMSC 435/634.
June 9, 2008 Dr. Haim Levkowitz IVPR/CS/UML | 1 Texture.
Course 9 Texture. Definition: Texture is repeating patterns of local variations in image intensity, which is too fine to be distinguished. Texture evokes.
Fractals smooth surfaces and regular shapes - Euclidean-geometry methods -object shapes were described with equations natural objects - have irregular.
December 9, 2014Computer Vision Lecture 23: Motion Analysis 1 Now we will talk about… Motion Analysis.
Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The.
Digital Image Processing Lecture 10: Image Restoration March 28, 2005 Prof. Charlene Tsai.
Digital Image Processing Lecture 10: Image Restoration
Create Procedural Textures with Perlin Noises
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shaders in OpenGL Marshall Hahn. Introduction to Shaders in OpenGL In this talk, the basics of OpenGL Shading Language will be covered. This includes.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Material obtained from Summer workshop in Guildford County, July, 2014 Unit 6.
Bump Map 1. High Field Function: H(u, v) New Normal : N’
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
Real-Time Rendering Cody Tankersley.  Term Project Overview ◦ Desired Shaders  What is noise?  A Little History….  Noise Functions ◦ Some Implementation.
Week 3 Lecture 4: Part 2: GLSL I Based on Interactive Computer Graphics (Angel) - Chapter 9.
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.
OpenGL Shading Language
Programming with OpenGL Part 3: Shaders Ed Angel Professor of Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive.
GLSL I.  Fixed vs. Programmable  HW fixed function pipeline ▪ Faster ▪ Limited  New programmable hardware ▪ Many effects become possible. ▪ Global.
67535: Computer Games Programming Week 2: Randomness: Perlin noise and Fractals Lighting: Phong-Blinn-Giraud; HDR Tutorial: Phong lighting in a fragment.
Part II – Photorealistic Rendering (1) Texture (4) CPSC 591/691.
1 What did we learn before?. 2 line and segment generation.
CSE 681 Texture Mapping: Solid Texturing. CSE 681 Texture Mapping Visual complexity on demand Vary display properties over object Location on object used.

Game Design, Development, and Technology
Noise | Course Overview Jim Whitehead
Digital Image Processing Lecture 10: Image Restoration
Basic Rendering Techniques
Shading CMSC 435/634.
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Introduction to Computer Graphics with WebGL
Day 05 Shader Basics.
UMBC Graphics for Games
Programming with OpenGL Part 3: Shaders
Computer Graphics Lecture 15.
CS 480/680 Computer Graphics GLSL Overview.
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
Presentation transcript:

Procedural Textures

Primitives glsl has some built-in functions that can be used to generate simple textures returns 0.0 if x < a, 1.0 otherwise float f = step(a, x); f 1 a

Primitives returns 0.0 if x < a, 1.0 if x > b, and performs smooth interpolation between a and b float f = smoothstep(a, b, x); f 1 a b

Primitives a pulse can be formed using two steps can also use smoothstep to generate a smooth pulse (p189) float f = step(a, x) – step(b, x); 1 f a b

Primitives clamp restricts a value to lie within a range float f = clamp(x, a, b); 1 f b a a b

Primitives mod is useful for generating periodic functions for any function f(x) where 0 <= x < 1 f( mod(x, a) / a) is periodic works best if f(0) = f(1) and f’(0) = f’(1)

Primitives consider the following fragment shader in vec2 vST; out vec4 fFragColor; void main( ) { const float N = 16; const float F = 1.0 / N; float x = mod(vST.s, F) / F; float r = smoothstep(0.4, 0.6, x); fFragColor = vec4( r, 1., 0., 1. ); }

Primitives N=2 N=3 N=4 N=16

Primitives somewhat better using a smooth pulse in vec2 vST; out vec4 fFragColor; void main( ) { const float N = 16; const float F = 1.0 / N; float x = mod(vST.s, F) / F; float r = smoothstep(0.0, 0.2, x) – smoothstep(0.5, 0.7, x); fFragColor = vec4( r, 1., 0., 1. ); }

Primitives N=2 N=3 N=4 N=16

Primitives others sin cos abs mod(x, a) / a will produce a sawtooth pattern splines are common primitives, but not supported directly in glsl

Irregular Textures many natural textures are irregular and cannot easily be described using the previous simple primitive functions natural phenomenon (clouds, fire, smoke) natural materials (marble, wood, mountains) man-made materials (stucco, asphalt, cement) surface imperfections (rust, dirt, wear) pattern imperfections (wiggles, bumps, color variation) motion imperfections in 1985 Ken Perlin described a method of procedural texture generation called “noise”

Noise Textures noise textures are not true noise in the sense that they are not truly random a truly random function is not useful for most image generation purposes because we want repeatability i.e., the texture value for (s, t) should always be the same otherwise the texture will change everytime we render the object! also, the texture values in a small neighborhood around (s,t) should be similar otherwise small changes to (s, t), such as what would occur when the camera or object moves, might produce dramatically different images

Noise Texture Properties a noise function should have certain properties continuous function that appears random repeatable, i.e., the texture value for any (s, t) is constant has a well defined range, usually [0, 1] or [-1, 1] does not show obvious regular or periodic patterns isotropic (rotationally invariant) can be defined in 1, 2, 3 or higher dimensions

Lattice Noise Textures many of the noise functions used in graphics are lattice based generate random points at regularly spaced intervals interpolate between the points using a continuous function usually a cubic or quintic spline see textbook p215-220

Value Noise Textures “value” noise interpolates the lattice points and assumes that the gradient at each lattice point is zero (or has a “natural” value)

Gradient Noise Textures “gradient” noise has a value of zero at each lattice point with a pseudorandom gradient

Value+Gradient Noise Textures “value + gradient” noise interpolates each lattice point with a pseudorandom gradient

Value vs Gradient value noise gradient noise

Gradient vs Value+Gradient gradient noise value+gradient noise

Noise Frequency we can view our noise function f(x) as being one cycle of a periodic function the function g(x) = f(2x) is a noise function with two cycles; i.e., g(x) has twice the frequency of f(x) f(x) g(x)

Noise Octaves obviously g(x) is not a good noise function it is by construction periodic however, it will have more fine scale detail g(x) is called an octave of f(x) the ratio of their frequencies is 2:1 consider h(x) = f(x) + g(x) this might hide the obvious periodicity while providing the fine scale detail the magnitude might be too big though

Noise Octaves consider h(x) = f(x) + (½)g(x) = f(x) + (½)f(2x) this is called two octave 1/f noise or two octave fractional Brownian motion (FBM) noise

Noise Octaves consider f(x) + (½)f(2x) + (½)(½) f(4x) three octave 1/f or FBM noise

Noise Octaves consider five octave 1/f or FBM noise

“OpenGL Shading Language, 3rd Edition”

“OpenGL Shading Language, 3rd Edition”

noisegraph noisegraph is a program distributed with glman that lets you experiment (a bit) with lattice noise textures