RealTime Hair Rendering Agenda Introduction Hair Geometry Hair

  • Slides: 25
Download presentation
Real-Time Hair Rendering Гнатюк Денис

Real-Time Hair Rendering Гнатюк Денис

Agenda ü Introduction ü Hair Geometry ü Hair Shading

Agenda ü Introduction ü Hair Geometry ü Hair Shading

Introduction ü 4, 095 individual hairs ü 123, 000 vertices (just for the hair

Introduction ü 4, 095 individual hairs ü 123, 000 vertices (just for the hair rendering)

Hair Geometry

Hair Geometry

Data Flow

Data Flow

Data Flow

Data Flow

Tessellation

Tessellation

Interpolation Barycentric coefficients: b. A + b B + b C = 1 Interpolated

Interpolation Barycentric coefficients: b. A + b B + b C = 1 Interpolated hair Y : Y = A x b. A + B x b. B + C x b. C

Interpolation

Interpolation

Interpolation

Interpolation

The Effect of Tessellation and Interpolation

The Effect of Tessellation and Interpolation

Modulate density across scalp

Modulate density across scalp

Curly Hair

Curly Hair

Hair Shading üa local reflectance model for hair üa method for computing self-shadowing between

Hair Shading üa local reflectance model for hair üa method for computing self-shadowing between hairs

A Real-Time Reflectance Model for Hair The Marschner Reflectance Model S(f i , q

A Real-Time Reflectance Model for Hair The Marschner Reflectance Model S(f i , q i ; f o , q o ) S = SR + STT + STRT Sp = Mp (q i , q o ) x Np (q d , f d ) for P = R, TT, TRT q d = ½(q i – q o ), f d = f i – f o

Lookup Textures for the Marschner Hair Reflectance Model

Lookup Textures for the Marschner Hair Reflectance Model

Reflectance

Reflectance

Pseudocode Summarizing the Shaders // In the Vertex Shader: Sin. Theta. I = dot(light,

Pseudocode Summarizing the Shaders // In the Vertex Shader: Sin. Theta. I = dot(light, tangent) ; Sin. Theta. O = dot(eye, tangent) ; Light. Perp = light – Sin. Theta. I * tangent ; eye. Perp = eye – Sin. Theta. O * tangent ; Cos. Phi. D = dot(eye. Perp, light. Perp) * (dot(eye. Perp, eye. Perp) * dot(light. Perp, light. Perp))^-0. 5 // In the Fragment Shader: (MR, MTT, MTRT, cos. Theta. D) = lookup 1(cos. Theta. I, cos. Theta. O) (NTT, NR) = lookup 2(Cos. Phi. D, cos. Theta. D) NTRT = lookup 3(Cos. Phi. D, cos. Theta. D) S = MR * NR + MTT * NTT + MTRT * NTRT

Real-Time Volumetric Shadows in Hair Ø Stencil Shadow Volumes Ø Shadow Maps ü Opacity

Real-Time Volumetric Shadows in Hair Ø Stencil Shadow Volumes Ø Shadow Maps ü Opacity Shadow Maps !

Opacity Shadow Maps - T(x, y, z) is the fraction of light penetrating to

Opacity Shadow Maps - T(x, y, z) is the fraction of light penetrating to depth z - σ is called the opacity thickness - r(x, y, z) is the extinction coefficient

Opacity Shadow Maps To compute σ at a discrete set of z values z

Opacity Shadow Maps To compute σ at a discrete set of z values z 0. . . z n-1 where z i < z i+1. - n = 16 - z 0 being the near plane of the hair in light space - z 15 being the far plane of the hair in light space - z i = z 0 + i dz, dz = (z 15 – z 0)/16

Opacity Shadow Maps

Opacity Shadow Maps

Results

Results

Results

Results

Q&A

Q&A