• Non ci sono risultati.

Texture maps assets e Mesh assets

N/A
N/A
Protected

Academic year: 2021

Condividi "Texture maps assets e Mesh assets"

Copied!
22
0
0

Testo completo

(1)

Texture maps assets e Mesh assets

Non necessariamente 1:1

1:N -- vari texture «sheets» associati ad una mesh N:1 -- più meshes sullo stesso sheet (bene)

esempio di struttura per :

ogni mesh associata a un materiale ogni materiale:

1 sheet di diffuse-map 1 sheet bumpmap (se serve) 1 sheet di alphamap (se serve) 1 vertex + fragment shader vari parametri

(es, shininess, …)

se parti diverse di mesh associate a tessiture diverse:

scomporre oggetto in sottomesh

Notazione di spazio texture

Texture 2D

s t

texel

Texture Space

(o "spazio parametrico" o "spazio s-t" o "spazio u-v")

Texture space

= [0,1] x [0,1]

es: 512 texels

es: 1024 texels

1.0 1.0

(2)

Due notazioni

s-t (es OpenGL)

s t

1.0

1.0 u

v

1.0

1.0

u-v (es DirectX) (0,0)

(0,0)

più diffusa

(in game industry)

più diffusa

(in game industry)

Task di modellazione:

“u-v mapping”

(“u-v” == “s-t”)

Assegnare una coppia di coordinate texutres ad ogni vertice della mesh

In preprocessing

s t

s t

(3)

Task di modellazione:

“u-v mapping”

(“u-v” == “s-t”)

fatto a mano,

oppure automatizzato

Texture “atlas”

(composto di vari “charts”)

Task di modellazione:

“u-v mapping”

(“u-v” == “s-t”)

strategie pratiche:

1. selezionare edge di taglio

…o…

1. assegnare facce a charts

decidere dove sono i “texture seams”

2. unfolding

minimizzare “distorsione”

3. packing dei charts minimizzare spazi vuoti

assegnare aree secondo necessita’

(es, parti importanti maggiore spazio tessitura)

(4)

Tileable Textures

A A

B

B

Tileable textures

(5)

Tileable textures

Tipico utilizzo:

Molto efficiente in spazio!

Image first, then UV-mapping

e.g. immagine da fotografie e.g. tileable images

RGB maps:

come si ottengono

UV-mapper 2D painter

/

3D modeller

/

(6)

Texture maps come assets

Vari texture «sheets»

associati ad una mesh

o anche: più meshes sullo stesso sheet (bene)

tipica struttura dati:

mesh divisa in sottomesh

ogni sottomesh associata a un materiale ogni materiale:

1 sheet di diffuse-map 1 sheet bumpmap (se serve) 1 sheet di alphamap (se serve) 1 vertex + fragment shader vari parametri

(es, shininess, …)

RGB maps:

come si ottengono

Image first, then UV-mapping

e.g. immagine da fotografie e.g. tileable images

UV-mapping

first, then

paint 2D

paint with 2D app(e.g. photoshop)

UV-mapping

first, then

paint 3D

paint within 3D modelling software,

or: 1. export 2D rendering,

2. paint over with e.g. photoshop, 3. reimport images

4. goto 1

UV-mapper

UV-mapper 2D painter

UV-mapper 3D painter

(7)

RGB maps:

come si ottengono

…or:

first Paint 3D

on hi-res model,

“paint” on vertex attributes e.g. with Z bursh…

then coarsen

build / autobuild final low-poly version

then UV-map

the low-poly model must be a 1:1 mapping!

then auto-texture

auto build texture

more about

this later…

Alpha mapping

(texels = lvl trasparenza)

Alpha map

RGB map

(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

Alpha mapping

(texels = lvl trasparenza)

es: drappi, barba...

by Micheal Filipowski 2004

tessitura

Texture mapping e Alpha Test

es: alberi, foliage

(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, pellicce

tessitura (ripetuta)

Bump-Mapping (see demo)

stessa geometria (una sfera) bumpmaps diverse

(10)

Bump maps: Categorie

Bump maps

Normal maps

Displacement maps

Object Space

Tangent Space

Scalar Vector

Bump maps: Categorie

Bump map:

qualunque tessitura che codifica dettagli hi-freq (“meso-struttura”) su una sup low-res

Normal Map:

Dettagli codificati memorizzando le normali della sup hi-freq Modificano il lighting

In quale spazio (in che base vettoriale)?

Tangent Space: (spazioTBN)

Riutilizzabili su più superfici indipendentemente dall’oreintamento Richiede direzioni Tangenti-Bitangenti (e normali) def su superifcie Object Space:

Solo per UV-mapping 1:1

Displacement Map

Dettagli codificati memorizzando le differenze fra low-res e hi-freq Come vettori, oppure come scalari(distanza lungo la normale) Usati per re-tasselation, o per effetto parallasse (parallax mapping)

caso più comune, di “bump map”

(11)

Normal maps

Memorizzati come immagini

RGB => XYZ

(come?) caratteristico colore RGB

(0.5,0.5,1) - (128,128,255)

(Tangent Space) Normal maps

Espressi in spazio tangente

Memorizzare direzioni tangenti Tangente e Bi-tangente

Nuovi attributi x vertice!

Computati automaticamente a partire da UV mapping (come?)

(12)

Normal maps

Come si ottengono (1/3):

Displacement map come grayscale

= estruso - in fuori

= profondo - incassato

Filtro (e.g.

photoshop) 2D texture

painter

Normal map

Normal maps

Come si ottengono (2/3):

Photometric Stereo

da: N immagini (N>=4) reali Stesso punto di vista

Illuminazione diversa

(e possibilmente controllata e nota)

a Normal Map

(13)

Normal maps

Come si ottengono (3/3):

Detail recovery 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)

More about this later…

Normal maps

Come si ottengono (bonus):

Proceduralmente

(14)

Semplificazione automatica aka. “poly reduction”

Strategie completamente diverse

Approcci iterativi repeat

compi l'azione di semplificazione atomica meno costosa

(in termini di errore aggiunto) aggiorna costi

until (obiettivo raggiunto)

es: numero faccie, errore

remove vertex

remove face

edge collapse

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

Semplificazione automatica

Strategie completamente diverse

Vertex clustering:

dividi i vertici originali in una griglia regolare

"collassa" in un solo vertice tutti quelli nella stessa casella

togli i triangoli che hanno solo 1 o 2 vertici diversi Approssimazione dipende da dimensione griglia

(15)

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

Semplificazione automatica

Simplificazione ad edge collapse (adattva)

215k faces

Semplificazione a clustering (non adattiva)

235k faces

Semplificazione automatica

Strategie completamente diverse

Fitting di piani

sostituire molte facce con poligoni planari quando i loro vertici sono quasi coplanari

Cohen-Steiner, Alliez, Desbrun (SIGGR04)

(16)

Detail preservation / recovery (o "texture for geometry")

Idea:

data

una mesh A low res, uv-mapped una mesh B hir res

sintetizzare una tessitura per A per ripristinare il dettaglio hi-freq presente in B

es: A ottenuto da B tramite

semplificazione automatica

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

500mila triangoli

2mila triangoli

semplificazione automatica

sempre duemila triangoli, ma con texture mapping

rendering

TESSITURA fatta apposta (es. BumpMap

normali o RGB map x colori) detail

recover

(17)

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

simplificato

2K triangles

originale

500K triangles

semplificato ma con tessitura

2K triangles

Detail Recovery: how to

Hi-res model Low-res

model

Texture map

u v

find a suitable spot

Some attribute

e.g.: color, precomputed shading, normal...

Code & Store find a suitable spot

(18)

Esempio

Esempio

(19)

esempi da cg-talks – CG society

sempi da cg-talksCG society

(20)

esempi da cg-talksCG society

Mesh: task tipici nella game industry

Poly reduction / Retopology

e.g. LOD construction

Light baking

Precomputazione Luce e.g.: Ambient Occlusion

U-V mapping

parametrizzazione

Texturing

creazione tessiture di vario tipo

Rigging / Skinning / Animation

more about this next time

(21)

Una classe di tool utili:

attribute transfer

Attribute transfer

Da mesh A a mesh B Retargeting di:

Animazioni, UV-mapping, tessiture, …

Solid textures

(22)

Solid Textures

Tessituravolumetrica voxelizzata 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 MIP mapping, filtering in accesso…

Modellano colore di tutto il volume

superficie + interno utile, per es, per fratture

Nota: nessun bisogno di UV-mapping!

tessitura indicizzata con geometria mesh

Solito problema: spazio ram

Cubico con risoluzione Soluz: tessiture procedurali?

Riferimenti

Documenti correlati

Results: Multivariate linear regression analysis showed a statistically significant association between several magnetic resonance imaging and diffusion tensor imaging metrics and

8 Non-periodi sampled-data onsensus in se ond-order multi-agent systems with ommuni ation delays over an un ertain network 143 8.1 Introdu

The combination of molecular (Raman, SERS, FORS, HPLC-MS) and elemental (SEM- EDX) techniques allowed the identification of all the pigments used in the miniatures. Natural

I segnalatori grafici di inizio frazione, linea di frazione e fine frazione osservabili nella figura 2 possono essere inseriti mediante scorciatoie da tastiera e vengono

Non sarà male sottolineare il fatto che tra i vari santi che compiono il miracolo classico della trasformazione dell'acqua in vino non vi sono santi aristocratici, pii monaci

Sulla base degli obiettivi della rilevazione (osservazione della distribuzione degli in- vestimenti intangibili nelle imprese italiane con almeno 10 addetti nel corso del 2012) e

Though there could be some short-term adjustment costs, overall refugees and migrants represent untapped potential: if properly integrated into their local community and the