Procedural Shading And Texturing

2y ago
6 Views
2 Downloads
8.98 MB
36 Pages
Last View : 2m ago
Last Download : 3m ago
Upload by : Sasha Niles
Transcription

Procedural shading andtexturing

Local shading is complex Assume we know diffuse, specular, transmitted, ambientcomponentsMust apply texturefrom mapproceduralvolumebumpdisplacementopacityetc device for managing this complexity Shaders

Texturing Makes materials lookmore interesting– Color - e.g. decals– Opacity - e.g. swisscheese, wire– Wear & tear - e.g.dirt, rustProvides additional depthcue to human visualsystem

Texture Mapping Maps image onto surface Depends on a surface parameterization(s,t)– Difficult for surfaces with manyfeatures– May include distortion– Not necessarily 1:1Kettle, by Mike Miller

Texture synthesis Use image as a source of probability modelChoose pixel values by matching neighbourhood, thenfilling inMatching process look at pixel differencescount only synthesized pixels

From “Image quilting for texture synthesis and transfer”, Efrosand Freeman, SIGGRAPH 2001

From “Image quilting for texture synthesis and transfer”, Efrosand Freeman, SIGGRAPH 2001

From “Image quilting for texture synthesis and transfer”, Efrosand Freeman, SIGGRAPH 2001

From “Image quilting for texture synthesis and transfer”, Efrosand Freeman, SIGGRAPH 2001

From “Image analogies”, Herzmann et al, SIGGRAPH 2001

From “Image analogies”, Herzmann et al, SIGGRAPH 2001

Solid Texturing Uses 3-D texture coordinates (s,t,r)Can let s x, t y and r zNo need to parameterize surfaceNo worries about distortionObjects appear sculpted out of solidsubstanceSurfaceTexturefeaturesdon’tline upSolidTexturefeaturesdoline upDarwyn Peachey, 1985

Solid TextureProblems How can we deform an objectwithout making it swim throughtexture?How can we efficiently store aprocedural texture?

Procedural Texturing0 Texture map is a functionWrite a procedure to perform the function– input: texture coordinates - s,t,r– output: color, opacity, shadingExample: Wood– Classification of texture space intocylindrical shellsf(s,t,r) s2 t2– Outer rings closer together, whichsimulates the growth rate of real trees– Wood colored color table Woodmap(0) brown “earlywood” Woodmap(1) tan “latewood”Wood(s,t,r) Woodmap(f(s,t,r) mod 1)f(s,t,r) s2 t2Woodmap(f)Wood(s,t,r)1

Noise Functions Add “noise” to make textures interestingPerlin noise function N(x,y,z)– Smooth– Correlated– BandlimitedN(x,y,z) returns a single random numberin [-1,1]Gradient noise– Like a random sine waveN(x,y,z) 0 for int x,y,zValue noise– Also like a random sine waveN(x,y,z) random for int x,y,z

Using Noise Add noise to cylinders to warp wood– Wood(s2 t2 N(s,t,r)) Controls– Amplitude: power of noise effecta N(s, t, r)– Frequency: coarse v. fine detailN(fs s, ft t, fr r)– Phase: location of noise peaksN(s φs, t φt, r φr)

Making Noise Good:– Create 3-D array of random values– Trilinearly interpolate Better– Create 3-D array of random 3vectors– Hermite interpolate

HermiteInterpolation Some cubic h(t) at3 bt2 ct d s.t.– h(0) 0(d 0)– h(1) 0(a b c 0)– h’(0) r0 (c r0)– h’(1) r1 (3a 2b r0 r1)Answer:– h(t) (r0 r1) t3 - (2r0 r1) t2 r0tTricubic interpolation– Interpolate corners along edges– Interpolate edges into faces– Interpolate faces into interior

Colormap Donuts Spotted donut– Gray(N(40*x,40*y,40*z))– Gray() - ramp colormap– Single 40Hz frequency Bozo donut– Bozo(N(4*x,4*y,4*z))– Bozo() - banded colormap– Cubic interpolation meanscontours are smooth

Bump MappedDonutsDnxn DNoise(x,y,z); normalize(n); DNoise(s,t,r) Noise(s,t,r)Bumpy donut– Same procedural texture as spotted donut– Noise replaced with DNoise

Composite Donuts Stucco donut– Noise(x,y,z)*DNoise(x,y,z)– Noisy direction– noisy amplitude Fleshy donut– Same texture– Different colormap

DNoise BumpMapped Refraction

Fractals Fractional dimension - not Fractal dimension exceeds topologicaldimension Self-similar Detail at all levels of magnification 1/f frequency distribution

How Can Dimensionbe Fractional?Point: D 0, N 1, s 1/2Line: D 1, N 2, s 1/2Square: D 2, N 4, s 1/2N (1/s)Dlog N D log (1/s)D log(N)/log(1/s)Cube: D 3, N 8, s 1/2

ExamplesN 2s 1/3D log 2/log 3D .6.N 4s 1/3D log 4/log 3D 1.3.

Brownian Motion random paths Integral of white noise 1/f 2 distributiondlog powerwhite noisebrown noiseFF1log f1/f 2log f

Fractional BrownianMotion 1/f β distribution Roughness parameter β– Ranges from 1 to 3– β 3 - smooth, not flat, stillrandom– β 1 - rough, not space filling, butthick Construct using spectral synthesis– Add several octaves of noisefunction– Scale amplitude appropriately

Fractal BumpMapped Donutfbm(beta) {val 0; vec (0,0,0);for (i 0; i octaves; i ) {val Noise(2i*x, 2i *y, 2i *z)/pow(2,i*beta);vec DNoise(2i*x, 2i *y, 2i *z)/pow(2,i*beta);}return vec or val;}

FractalMountains Displacement mapof meshed plane Can also be formed usingmidpoint displacementKen MusgraveGunther Berkus via Mojoworld

CloudsWaterGunther Berkus via Mojoworld

MarbleKen Perlin, 1985

FireKen Musgrave

PlanetsKen Musgrave

MoonriseKen Musgrave

From “Image quilting for texture synthesis and transfer”, Efros and Freeman, SIGGRAPH 2001. From “Image quilting for texture synthesis and transfer”, Efros and Freeman, SIGGRAPH 2001. From “Image quilting for texture synthesis

Related Documents:

different orientations, egg-crate shading and (egg-crate louver) shading devices. Previous authors have worked on different external shading devices on various glass materials to reduce the direct solar radiation into buildings. To study the various shading devices vertical fins, overhangs and egg-crate windows find the best shading device to

shading devices, the artificial loads of two best shading devices were compared. In sum, the egg-crate shading was the most proper shading device to block sunlight as well as reduce the cooling energy consumption e ectively. Keywords: daylight; cooling energy; shading device; residential building 1. Introduction

Lambert (flat) shading 3 3. Smooth shading and vertex normals 4 . obvious vertical edges, and the top and bottom will appear flat. There are three major shading techniques, one for flat shading and two for . systems will just select one of the

D. Function and usage: The shading devices' material detail and usage [4]. As mentioned above, the most important point at shading device design is to show variability of shading device performance on the base of sun's one-year motion [6]. Thereby, calculation of shading device design with traditional methods requires

shading devices were predicted to reduce solar gain by 13% to 55% and luminance level up to 9.3%, claiming a saving of 27.5% in the energy consumption. Tzempelikos and Athienitis (2007) evaluated the impact of glazing area, shading device and shading control on the energy demand and thermal comfort of a

Shading, Rendering and Texture Rendering –Color Pencil Only 1. As before use your shading technique to render with one color from light to dark 2. Select 2 colors and blend those 2 colors from 1 to another (E.G. Blue from the left, shading 6 squares right. Green from the left, shading

The use of sun control and shading devices is an important aspect of many energy-efficient building design strategies. In particular, buildings that employ passive solar heating or daylighting often depend on well-designed sun control and shading devices. During cooling seasons, external window shading is an excellent way to prevent

3. Dynamic Solar Shading and Complex Glazing 14 4. The Energetic Performance of Shading Systems 15 4.1. European Glazing and Shading Standards for Calculation of Energy Performance 15 4.2. Complex Glazing Energy Performance Calculation Methods 17 4.2.1.Total