Slide 1

Slide 1 text

Procedural Shading & Texturing Shinji Ogaki

Slide 2

Slide 2 text

Procedural Shading • Procedural shading Procedural shading is a proven rendering technique in which a short user- written procedure, called a shader, determines the shading and color variations across each surface. - Marc Olano • Procedural texture A procedural texture is a computer-generated image created using an algorithm intended to create a realistic surface or volumetric representation of natural elements such as wood, marble, granite, metal, stone, and others, for use in texture mapping. - Wikipedia

Slide 3

Slide 3 text

Advantages • Small memory footprint • Resolution independent

Slide 4

Slide 4 text

Famous Algorithms • An Image Synthesizer – Ken Perlin (Siggraph 1985) • A Cellular Texture Basis Function – Steve Worley (Siggraph 1996)

Slide 5

Slide 5 text

Today’s Topics • Voronoi cell • Fourier transform

Slide 6

Slide 6 text

Voronoi Cell

Slide 7

Slide 7 text

Voronoi Cell • Useful for mesoscale features (micro – meso - macro) • Inclusions, scratches, etc. Modeling Aventurescent Gems with Procedural Textures –Weidlich et al. (SCCG 2008) Multi-Scale Rendering of Scratched Materials using a Structured SV-BRDF Model – Raymond et al. (TOG 2016)

Slide 8

Slide 8 text

Voronoi Cell • Grid based Algorithm • No precomputation • Zero memory cost

Slide 9

Slide 9 text

Shading point Feature point 2D

Slide 10

Slide 10 text

Shading point Closest feature point 2D

Slide 11

Slide 11 text

Single Level

Slide 12

Slide 12 text

Multiple Levels

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Coloration • Use exemplar • Histogram matching • Poor performance • Spatial information is not taken into account • Fractional Brownian motion in 2D texture space

Slide 15

Slide 15 text

Voronoi Cell – Hash Function • 4D vector input – 4D vector output In (x,y,z,t): x,y,z:grid t:instance ID, etc. Out(x,y,z,t): x,y,z:feature point t:normal, color, density, etc. • Chaotic Hash Algorithms • Secure Hash Algorithms • MD5, SHA-0, SHA-1, SHA2, SHA-3, etc.

Slide 16

Slide 16 text

Voronoi Cell – Hash Function • 4D vector input – 4D vector output In (x,y,z,t): x,y,z:grid t:instance ID, etc. Out(x,y,z,t): x,y,z:feature point t:normal, color, density, etc.

Slide 17

Slide 17 text

w/o instance ID w/z instance ID

Slide 18

Slide 18 text

Voronoi Cell – Hash Function • 4D vector input – 4D vector output In (x,y,z,t): x,y,z:grid t:instance ID, etc. Out(x,y,z,t): x,y,z:feature point t:normal, color, density, etc.

Slide 19

Slide 19 text

Scratches • Remove if δ

Slide 20

Slide 20 text

Voronoi Cell – Hash Function • 4D vector input – 4D vector output In (x,y,z,t): x,y,z:grid t:instance ID, etc. Out(x,y,z,t): x,y,z:feature point t:normal, color, density, etc.

Slide 21

Slide 21 text

Inclusions • Ray marching • Normal vector • Sample warping δ>density, density’=density/δ • Spherical Fibonacci lattice id=(int)(N x density’)

Slide 22

Slide 22 text

Deformation • Surface: Pref (Reference position) • Volume: Open problem (Tetrahedrarization? Curve interpolation?)

Slide 23

Slide 23 text

Fourier Transform

Slide 24

Slide 24 text

Fourier Transform • Convolution • Ocean waves • Useful tool to design or analyze procedural noise patterns

Slide 25

Slide 25 text

Phase

Slide 26

Slide 26 text

Wave

Slide 27

Slide 27 text

Coil

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Fourier Transform Convolution

Slide 30

Slide 30 text

Convolution Input Kernel Input (Frequency space) Kernel (Frequency space) FFT FFT Element-wise multiplication IFFT Output

Slide 31

Slide 31 text

Convolution

Slide 32

Slide 32 text

Convolution

Slide 33

Slide 33 text

Convolution

Slide 34

Slide 34 text

Convolution

Slide 35

Slide 35 text

Convolution

Slide 36

Slide 36 text

Convolution

Slide 37

Slide 37 text

Convolution

Slide 38

Slide 38 text

Convolution

Slide 39

Slide 39 text

Convolution

Slide 40

Slide 40 text

Convolution

Slide 41

Slide 41 text

Convolution

Slide 42

Slide 42 text

Convolution Sum

Slide 43

Slide 43 text

Convolution Blurred signal

Slide 44

Slide 44 text

Convolution Input Kernel Input (Frequency space) Kernel (Frequency space) FFT FFT Element-wise multiplication IFFT Output

Slide 45

Slide 45 text

Convolution 2D

Slide 46

Slide 46 text

Convolution 2D • Gabor noise

Slide 47

Slide 47 text

Convolution 2D • Glare effect

Slide 48

Slide 48 text

Fourier Transform Ocean Waves

Slide 49

Slide 49 text

Ocean Waves • Sum of multiple waves

Slide 50

Slide 50 text

Ocean Waves • Sum of multiple waves

Slide 51

Slide 51 text

Ocean Waves • Sum of multiple waves

Slide 52

Slide 52 text

Ocean Waves • Sum of multiple waves

Slide 53

Slide 53 text

Ocean Waves • Sum of multiple waves

Slide 54

Slide 54 text

Ocean Waves • Sum of multiple waves

Slide 55

Slide 55 text

Ocean Waves • Empirical Directional Wave Spectra for Computer Graphics - Christopher J. Horvath (Digipro 2015) IFFT Ocean! Generate waves (Points in frequency space)

Slide 56

Slide 56 text

No content