• No results found

Advanced Rendering TechniquesAdvanced Rendering Techniques

N/A
N/A
Protected

Academic year: 2022

Share "Advanced Rendering TechniquesAdvanced Rendering Techniques"

Copied!
5
0
0

Laster.... (Se fulltekst nå)

Fulltekst

(1)

Tutorial 5: Programming Graphics Hardware

Advanced Rendering Techniques Advanced Rendering

Techniques

Matthias M Wloka

Tutorial 5: Programming Graphics Hardware

Nalu

Tutorial 5: Programming Graphics Hardware

Acknowledgements

Hubert Nguyen William Donnelly NVIDIA Demo Team

Tutorial 5: Programming Graphics Hardware

Long Blonde Hair

Long

Requires dynamic animation Thus cannot bake lighting Requires lots of hair

Thus shading has to be fast

Blonde

Three visible highlights, black only has one Shadows much more visible

Hair Rendering: Overview

Geometry and dynamics Shading

Shadowing

Hair Geometry, Part 1

“Skull cap” specifies Where control hairs grow

Which direction to grow Growth is non-linear 762 control hairs

Each is 7 vertices long

(2)

Tutorial 5: Programming Graphics Hardware

Hair Dynamics

Treat control hairs as particle system For all (7 * 762) vertices in control hairs do

Physics simulation

Collision detection and reaction Vertices of each control hair

Linked

Distance-constrained

Tutorial 5: Programming Graphics Hardware

Physics Simulation

Uses Verlet integration

Previous frame’s position computes velocity Less sensitive to frame rate

Apply forces, then apply constraints Iteratively

Particles converge

Thus take head -motion into account

Tutorial 5: Programming Graphics Hardware

Now Have 762 7-Vertex Control Hairs

Turn each control hair into 6 basic Bezier curves 1 control hair has 6 segments

1 basic Bezier requires 2 points and 2 tangents Concatenate and tessellate each set of 6 basic Bezier curves

Creates smooth control hair

Tutorial 5: Programming Graphics Hardware

Interpolate 3 smooth control hairs at a time Generates 4095 individual hairs

Interpolation is post-tessellation Performance reasons Tessellation is expensive

Generates ~123k total vertices for hair alone

Interpolate Control Hairs

Tutorial 5: Programming Graphics Hardware

Wire -Frame Demo

Tutorial 5: Programming Graphics Hardware

Hair Shading Based On

“Light Scattering from Human Hair Fibers”

By Steve Marschner , Henrik Wann Jensen, Mike Cammarano, Steve Worley, and Pat Hanrahan SIGGRAPH 2003

(3)

Tutorial 5: Programming Graphics Hardware

Paper Models 3 Distinct Highlights

Uses path notation R is reflection T is transmission

Figures from “Light Scattering from Human Hair Fibers” (see previous slide)

Tutorial 5: Programming Graphics Hardware

R and TRT Highlights

R – white primary highlight TRT – colored secondary highlight

Picture from “Light Scattering from Human Hair Fibers”

(see previous slides)

Tutorial 5: Programming Graphics Hardware

TT Highlight

TT – strong forward scattering component Important for underwater hair

Tutorial 5: Programming Graphics Hardware

Hair Model Is 4-Dimensional Function

Factor into lower dimensional terms M_R (thetaH ) * N_R (thetaD, phiD) + M_TT (thetaH) * N_TT (thetaD , phiD) + M_TRT(thetaH) * N_TRT(thetaD, phiD) Use 2D textures to encode as look-up tables

cos(thetaL ), cos(thetaE)

? M_R, M_TT, M_TRT, cos(thetaD) cos(thetaH ), cos(phiD)

? N_R, N_TT, N_TRT

Make Most Aspects Tweakable

Highlights:

Separation Strength Width Hair albedo Extinction coefficient

Hair Shading Demo

(4)

Tutorial 5: Programming Graphics Hardware

Shadowing

“Opacity Shadow Maps”

By Tae- Yong Kim and Ulrich Neumann SIGGRAPH 2001

Tutorial 5: Programming Graphics Hardware

Why Opacity Shadow Maps

Opacity shadow maps ask:

What percentage of light is blocked from here?

Vs. Is the light blocked from here?

Thus supports AA edges and volumetric rendering Regular shadow maps alias around edges Hair is 100% edges

Tutorial 5: Programming Graphics Hardware

Pictures From Tae-Yong Kim’s Website

No Shadows 15 slices 255 slices

Tutorial 5: Programming Graphics Hardware

For Each Point In Map Compute:

T(z): amount of light penetrating to depth z For hair:

Integral is sum over all strands between light and point being shadowed

Compute sum via additive blending

“Extinction coefficient” K controls darkness of shadows

Tutorial 5: Programming Graphics Hardware

Creating the Opacity Maps

Choose 16 slicing planes in hair Uniform distribution

In hair bounding sphere

For each hair-pixel and for each plane Is hair-pixel closer to light than plane?

Yes: add hair to contribution (plane) No: do nothing

Tutorial 5: Programming Graphics Hardware

Opacity Map Creation Implementation

Render all hairs to 16 render targets 16 passes

Render all hairs to 4 MRTs 4 passes

MRT shader is simple: 4 SLT and 4 MUL instructions

(5)

Tutorial 5: Programming Graphics Hardware

Using the Opacity Maps

Hair-pixel position determines Which opacity maps to look in Where in opacity map to look in Hair-pixel positions generated by lines

Linearly interpolated vertex values are equivalent

Tutorial 5: Programming Graphics Hardware

Using Opacity Maps Implementation

Vertex-shader computes

Texture coordinates for all 16 maps Blend-weights to use

Pixel -shader combines 16 look-ups Via 5 dot4 instructions

Add z-bias due counter limited z-resolution Just like regular shadow maps

Tutorial 5: Programming Graphics Hardware

Shadowing Demo

Before

After

Tutorial 5: Programming Graphics Hardware

Questions

http://developer.nvidia.com The Source for GPU Programming Matthias Wloka (mwloka@nvidia.com)

Referanser

RELATERTE DOKUMENTER

La oss (ikke helt realistisk) anta at luft strømmer laminært rundt metallkula, og at luftmotstanden (friksjonskraften) kan skrives p˚ a formen f = − bv, der v er kulas hastighet, og b

Miljømessige forholdsregler : Ikke la stoffet komme i kontakt med jord, overflate- eller grunnvann. 6.3 Metoder og materialer for forurensning og opprensing Metoder

Liervassdraget er viktig for sjøaure og laks, og lakseførende strekning i Glitra begrenses av et naturlig vandringshinder ved kote 70, ca 160 m oppstrøms Sjåstad 2

I selve planområdet må lydnivåer i området mellom 40 og 50 dBA forventes, nær møllene opp til ca 60 dBA.. Konsekvensutredning Fakken vindpark Tabell 4: Sammendrag av

Området rundt Herresbekken er preget av flere menneskelige inngrep. Som det fremgår av figur 1.3 under, går det en bilveg over nedre del av bekken, like over utløpet i Logna. Langs

Den opprinnelige planen var å gjøre en to-veis studie av intravenøst og intramuskulært nalokson, men vi hadde for lite ressurser, og også usikkerhet om vi kunne gjennomføre

selvmordsforsøk. Man vil søke å klarlegge sammenhengene mellom hormonelle faktorer, psykisk lidelse, belastende livshendelser og utvikling av risiko for suicidal og

Development of autonomous ships and increasing applications for multiple vehicle coordination have created a widespread interest in the development of advanced path planning