• Keine Ergebnisse gefunden

Parallax Mapping

N/A
N/A
Protected

Academic year: 2021

Aktie "Parallax Mapping"

Copied!
12
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Parallax Mapping

§   Given: coarse geometry + 2D texture + detailed height map

§   Problem with bump / normal mapping:

§  Only the lighting is affected – the image of the texture remains unchanged, regardless of the viewing direction

§  Motion parallax: near / distant objects shift very differently relative to one another

§  Extreme example:

(2)

§   Goal: "fake" motion parallax of detailed offset surface, although we only render coarse polygonal geometry

§   The general task in parallax mapping:

§  Assume that scan line conversion is at pixel P

§  Determine point that would be seen along v

§  Project onto polygonal surface → P'

§  Write the texel at (u', v') as a color into P

§  Problem: how does one find ?

Viewing ray / Eye vector

Polygonal surface

Displacement surface / Offset surface

P = (u,v) P = (u ,v )

P ˆ

P

P

Pˆ Pˆ

Texture

v

P ˆ

D(u,v)

(3)

§  Simplest idea:

§  We know the height D = D(u,v) at point P = P(u,v)

§  Use this as an approximation of D(u',v') in point P' = P'(u,v)

§ 

P

D

P d

n

v

D

d = tan✓ = sin✓

cos✓ = cos

sin = |nv|

|n ⇥ v|

(4)

§  Storage:

§  Put the image in the RGB channels of the texture

§  Put the heightmap in the alpha channel

§  Process at rendering time:

§  Compute P' (see previous slide)

§  Calculate (u',v') of P' ⟶ lookup texel

§  Perturb normal by bump mapping (see CG1)

-  Note: today one can calculate directional

derivatives for Du and Dv "on the fly" (needed in bump mapping algo)

§  Evaluate Phong model with texel color and perturbed normal

RGB

Alpha

(5)

Example

Normal Bump Mapping Parallax Mapping

(For demonstration purposes, parallax is strongly exaggerated here)

(6)

§  Improvement:

[Premecz, 2006]

§  Let with D = D(u,v)

§  Approximate the heightmap in through a plane (similar to bump mapping)

§  Calculate the point of intersection

between that plane and the view vector:

§  Solve for t

§  , with v' = v projected into polygon's plane

§  Additional (closely related) ideas: iteration, higher approximation of the

heightmap

Thesis …

✓ u

0

v

0

=

✓ u v

+ t v

0

P¯ = (u,v,D)

v

ˆ n

(u,v)

(u ,v ) polygon

P ˆ

P ¯ P ¯

ˆ n

0

@ 0

@u v 0

1

A + tv

0

@u v D

1 A

1

A = 0

(7)

Alternatives

[Donnelly, 2005]

§   Do sphere tracing along the view vectors, until you hit the offset surface

§  If the heightmap contains heights that are not too large, it is sufficient to

begin relatively close underneath/

above the plane of reference

§  If the angle of the view vector is not too acute, then a few steps are

sufficient

§  For a layer underneath the plane of

reference, save the smallest distance

to the offset surface for every cell

(8)

View-Dependent Displacement Mapping (VDM)

§  Idea: precompute all possible texture coordinate displacements for all possible situations

§   In practice:

§  Parameterize the viewing vector by in the local coordinate system of the polygon

§  Precompute the texture displacement for all (u,v) and all possible

-  Ray casting of an explicit, temporarily generated mesh

§  Carry out the whole for a set of possible curvatures c of the base surface

§  Results in a 5-dim. "texture" (LUT):

n

v

d

1 2 3

4

d ( u, v , , ⇥, c )

(✓, )

(✓ , )

(9)

§   Advantage: results in a correct silhouette

§  Reason: for many parameters near the silhouette

§  These are the pixels that lie outside of the silhouette!

§  Further enhancement: self shadowing

§  Idea is similar to ray tracing: use "shadow rays"

1. Determine from D and θ,ϕ (just like before) → (u,v) displacement d 2. Determine vektor l from to the light source; and calc θl , ϕl from that 3. Determine from and θl and ϕl

4. Make lookup in our "texture" D → d'' 5. Test:

→ pixel (u,v) is in shadow

⟶ don't add light source l in Phong model

d ( u , v , , ⇥, c ) = 1

v l d

l

(u ,v ) (u,v)

d''

P = (u ,v ) Pˆ

d00 + d < k(u00,v00)–(u,v)k

(10)

§  Result:

§  Names:

§  Steep parallax mapping, parallax occlusion mapping, horizon mapping, view- dependent displacement mapping, ...

§  There are still many other variants ...

§  "Name ist Schall und Rauch!" ("A name is but noise and smoke!")

Bump Mapping VDM

(11)

More Results

Bump mapping Standard VDM VDM with self-shadowing

(12)

All Examples Were Rendered with VDM

Referenzen

ÄHNLICHE DOKUMENTE

The bounding volume of the surface with a displacement map applied to it is given by a prism ob- tained by displacing the base triangle along the vertex normals to the

10 Im Gegensatz zum Sichten-Mechanismus von SchemaSQL, bei dem diese M¨oglichkeit nicht vorhanden ist... Als augenscheinlichste Erweiterung von FISQL gegen¨uber SQL ist sicher

– nicht immer “exact match” möglich – “fuzzy match” / Abstandsfunktion Problempotential.. SchemaSQL

UrbaneGeschichten 1 is a project and mobile web platform for a bottom-up citizens’ chronicle. It aims at collecting and mapping everyday life stories directly from

● Mapping distributed through Map Request / Reply message exchange. ●

Owing to their excellent dressed stone, the mighty Ḥimyarite fortification walls and the finer ones of the royal buildings have been an attractive source of building material for

[r]

20 Please refer to the following for further information: The NHS Foundation Trust Code of Governance, Monitor, April 2010; The Healthy NHS Board: principles for good