normal maps: come si ottengono (2/4) - vcg - home...

11
Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016 1 Normal maps: come si ottengono (2/4) Photometric Stereo (una forma di “inverse lighting”) da: N immagini (N>=4) reali Stesso punto di vista Illuminazione diversa (possibilmente, controllata e nota) a Normal Map in spazio vista! convertire in spazio oggetto, o TBN Normal maps come si ottengono (3/4) Normal-Painting sul modello (e.g. con Z-brush, Sculptris Alpha…) simile a pittura delle diffuse maps ma painting di dettagli geometrici simile a scuplting ma il sistema scrive direttamente normali, non geometria

Upload: others

Post on 01-Sep-2019

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 1

Normal maps:come si ottengono (2/4)

� Photometric Stereo

� (una forma di

“inverse lighting”)

� da: N immagini (N>=4) reali

� Stesso punto di vista

� Illuminazione diversa

� (possibilmente, controllata e nota)

� a Normal Map

� in spazio vista! � convertire in spazio oggetto, o TBN

Normal mapscome si ottengono (3/4)

� Normal-Painting sul modello

� (e.g. con Z-brush, Sculptris Alpha…)

� simile a pittura delle diffuse maps

� ma painting di dettagli geometrici

� simile a scuplting

� ma il sistema scrive direttamente normali, non geometria

Page 2: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 2

Normal mapscome si ottengono (4/4)

� Detail recovery

“detail texture” synthesis

baking delle tessiture

� da:

� 1) mesh Hi-Res

� 2) mesh Low-res + UV mapping (senza ripetizioni)

� a:

� Normal map per 2(che mimica il dettaglio presente in 1)

Detail texture synthesis(aka detail preservation)

� Idea:� input:

� a low res mesh A,with (injective) UV-map

� a hi-res mesh Bwith per vertex attributes

� output:a texture for Acapturing the vertex attributes in B� normals? a normal map is produced

(in object space, convert to TBN if necessary)� base color? a diffuse maps is produced� baked (global lighting)? a light-map is produced

� fully automatic!

es: A ottenuto da B

tramite

semplificazione

automatica

Page 3: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 3

Modelling + Texturing:Pipeline production example

� Concept drawings� 2D artists

� Low-poly model A� 3D modeller, low poly editing tools

� (Injective) UV-mapping of A� UV-mapper, or automatic tool, to build UV-map for A

� Subdivision, digital sculpting of Hi-Res model B� 3D modeller, digital sculpting

� Painting over B� per vertex painting

� Detail Recovery:� Automatic construction of Textures for A with attributes from B:

� Normals from B, (normal map)

� Colors from B (diffuse map)

� Baked lighting from B (light-map)

M a r c o T a r i n i ‧ [ G A M E - D E V ] ‧ V e r o n a ‧2 0 1 3

hi-res

mesh

low res

mesh

semplificazioneautomatica

still low-res, but textured!

rendering

TESSITURA

fatta apposta(es. BumpMap

normali o RGB map x colori)

detail

recover

Page 4: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 4

M a r c o T a r i n i ‧ [ G A M E - D E V ] ‧ V e r o n a ‧2 0 1 3

simplificato2K triangles

originale500K triangles

semplificato ma con tessitura2K triangles

Detail Recovery: how to

Hi-res

model

Low-res

model

Texture map

u

v

find a suitable spot

Some

attributee.g.: color,

precomputed shading,

normal...

Code & Store

find a suitable spot

Page 5: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 5

Esempio

Esempio

Page 6: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 6

esempi da cg-talks – CG society

ese

mp

i d

a c

g-t

alk

s–

CG

so

cie

ty

Page 7: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 7

ese

mp

i d

a c

g-t

alk

s–

CG

so

cie

ty

Cutout texturestexels = alpha (lvl trasparenza)

Alpha map

RGB map

Page 8: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 8

M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 1 / 1 2 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a

Cutout texturestexels = alpha (lvl trasparenza)

� es: drappi, barba...

by Micheal Filipowski2004

tessitura

Cutout texturestexels = alpha (lvl trasparenza)

� es: alberi, foliage

Page 9: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 9

M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 1 / 1 2 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a

Texture mapping e Alpha Test

� Es: pelo, pelliccetessitura(ripetuta)

“Procedural Textures”

� Idea: textures come funzioni di (u,v)

� E.g.: color texture per bandiera del giappone:

u

v

1.0

0.5

0.3

1.00.5

=

else

if

v

uf

)1,1,1(

)0,0,1(2

2

3.05.0

5.0<

v

u

Page 10: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 10

“Procedural Textures”

� Funzione da (u,v) a valori texel� Da computare dinamicamente, durante il rendering

� (per frammento)

� invece di accedere ad array 2D di texel

� Vantaggi:� costo in RAM: quasi azzerato

� resolution independent

� ALU, invece di accessi in (texture) RAM:� meno caro, quasi sempre!

� Usate per immagini semplici

� Funz. implementata nel fragment shader

Solid Textures

Page 11: Normal maps: come si ottengono (2/4) - VCG - Home Pagevcg.isti.cnr.it/~tarini/teaching/gamedev2015/13.textures.pdf · Video Game Dev - Uni Insubria 09/11/2015 Marco Tarini - 2015/2016

Video Game Dev - Uni Insubria 09/11/2015

Marco Tarini - 2015/2016 11

Solid Textures

� Tessitura volumetrica voxelizzata: array 3D di texels� 1 texel == 1 voxel

� E.g. ogni voxel un colore RGB � solid RGB textures

� Come tutte le tessiture:� In video RAM

� Accesso veloce durante rendering

� filtering (tri-lineare) in accesso, MIP mapping …

� Modellano colore sul volume � superficie + interno

� utile, per es, per fratture

� Nota: nessun bisogno di UV-mapping!� tessitura indicizzata con geometria mesh (riscalata)

� Problema: spazio ram � Cubico con risoluzione

� Soluz: tessiture 3D procedurali?

Solid Textures Procedurali

Gyross - progetto di Paolo P. Slepoi