Texture mapping
Ogni texel è…
Un colore RGB (color map, RGB map,diffuse map) Una normale (bump map, o normal map)
Il coefficiente speculare (specular map) Un fattore di trasparenza (alpha map, o
cutout texture) Una scavo dalla superfice
(displacemnt map, oheight texture) Un lighiting precalcolato (light map ,
baked light texture)
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
Texture maps come assets
Caratteristiche:
Size:
risoluzione
canali (es: alpha?) MIP-maps precalcolati?
Tileable?
A A
B
B
Vincoli ricorrenti:
res come potenze di 2
(richiesto da sempre meno engines) sia in U che in V
(es: 256x256 o 1024x512)
res per lato < max
(es: max = 4096 o 2048)
Tileable textures
Tileable textures
Tipico utilizzo:
Molto efficiente in spazio!
MIP map levels
Pre-filtering delle tessiture
“LOD levels per immagini”!
Hardware sceglie livello giusto per pixel Evita artefatti di sottocampionamento
1024x1024
512x512
256x256
1x1
Texture maps come assets:
formati files
x immagini generiche
(decomprimere tutta immagine prima di accedere ai pixel)
☺compressione: ottima loading: pesante:
decomprimere da RAM, (forse) ricomprimere in GPU-RAM
MIP-map lvls etc:
controllato dall’engine
x textures
(random accessibility ai texels senza decomprimere)
compressione: cattiva
☺ loading: leggero
direct copy Disco => RAM =>
GPU RAM
☺ MIP-map lvls etc:
controllato dall’artista
Texture maps come assets:
formati files
x immagini generiche:
.JPG /.JPEG lossy,
☺> compresisone,
☺immagini “fotografiche”: best solo 3 canali (no choice) 8 bit x canale (no choice) .PNG
☺lossless
< compressione
☺disegni: best
☺anche canale alpha possibile
☺anche 16 bits possibile .TIFF e.RAW (rari)
x textures:
.DDS
(direct draw surface) lossy
compresisone: poco (a rate fisso)
☺GPU ready
☺inlcude MIPmap levels (volendo)
con compressione a scelta (S3TC):
DXT1 DXT2 DXT3 DXT4
“no / 1-bit alpha”
“rough alpha”
RGB maps:
come si ottengono
Image first, then UV-mapping
e.g. immagine da fotografie e.g. tileable images
UV-mapping
first, thenpaint 2D
paint with 2D app(e.g. photoshop)
UV-mapping
first, thenpaint 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
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
Alpha mapping
(texels = lvl trasparenza)
Alpha map
RGB map
Alpha mapping
(texels = lvl trasparenza)
es: drappi, barba...
tessitura
Texture mapping e Alpha Test
es: alberi, foliage
Texture mapping e Alpha Test
Es: pelo, pellicce
tessitura (ripetuta)
Bump-Mapping (see demo)
stessa geometria (una sfera) bumpmaps diverse
Normal maps
Memorizzati come immagini
RGB => XYZ
(come?) caratteristico colore RGB
(0.5,0.5,1) - (128,128,255)
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?)