#4: Faux Geometry Rendering tricks that give the - - PowerPoint PPT Presentation

4 faux geometry
SMART_READER_LITE
LIVE PREVIEW

#4: Faux Geometry Rendering tricks that give the - - PowerPoint PPT Presentation

#4: Faux Geometry Rendering tricks that give the appearance of geometry. WHY fake it? Algorithmic simplicity (get it done!) Representa9onal range


slide-1
SLIDE 1

#4: ¡Faux ¡Geometry ¡

Rendering ¡tricks ¡that ¡give ¡the ¡ appearance ¡of ¡geometry. ¡

slide-2
SLIDE 2

WHY ¡fake ¡it? ¡

  • Algorithmic ¡simplicity ¡(get ¡it ¡done!) ¡
  • Representa9onal ¡range ¡(do ¡it ¡all!) ¡
  • Rendering ¡9mes ¡(do ¡it ¡fast!) ¡
  • File ¡sizes ¡
slide-3
SLIDE 3

HOW ¡fake ¡it? ¡

  • Smoothing ¡(cos ¡θ) ¡
  • Color ¡(ks) ¡
  • Transparency ¡(ks) ¡
  • IrregulariFes ¡(θ) ¡

Tweak ¡the ¡rendering ¡equa9on ¡@ ¡ea ¡pixel: ¡ ¡ ¡ ¡ ¡ ¡Ir ¡= ¡Ii ¡• ¡ks ¡• ¡cos ¡θ ¡ ¡

slide-4
SLIDE 4

Smooth ¡shading ¡

  • Making ¡128 ¡polygons ¡do ¡the ¡work ¡of ¡11,680 ¡
  • Leverages ¡z-­‑buffer ¡hidden-­‑surface ¡

computa9on ¡

slide-5
SLIDE 5

Smooth ¡shading ¡

  • Tessella9on ¡insight ¡

– Polygons ¡are ¡approximate ¡ – Normals ¡can ¡vary! ¡ – How ¡to ¡calculate? ¡

  • Gouraud ¡said… ¡(“forget ¡the ¡normals”) ¡

– Calculate ¡the ¡intensity ¡(Ii ¡• ¡cos ¡θ) ¡ ¡at ¡each ¡corner ¡ – Average ¡adjacent ¡corners ¡ – Interpolate ¡along ¡edges ¡

slide-6
SLIDE 6

Smooth ¡shading ¡

slide-7
SLIDE 7

Smooth ¡shading ¡

  • The ¡problem ¡with ¡Gouraud ¡is ¡… ¡
  • With ¡in-­‑scene ¡lights, ¡there ¡should ¡be ¡hot ¡spots ¡
slide-8
SLIDE 8

Smooth ¡shading ¡

So ¡Phong ¡says ¡… ¡

  • Compute ¡an ¡average ¡normal ¡at ¡each ¡vertex, ¡
  • Interpolate ¡the ¡normals ¡and ¡compute ¡intensity ¡

at ¡each ¡pixel ¡(3x ¡the ¡work, ¡beWer ¡result) ¡

slide-9
SLIDE 9

Smooth ¡shading ¡

Nobody’s ¡perfect ¡… ¡

  • Phong ¡smoothing ¡sFll ¡shows ¡polygons ¡at ¡the ¡
  • bject ¡horizon ¡
slide-10
SLIDE 10

Surface ¡Colora9on: ¡Textures ¡

  • If ¡we’re ¡coloring ¡pixels ¡one ¡by ¡one ¡anyway, ¡

maybe ¡other ¡‘tweaks’ ¡would ¡be ¡useful? ¡

¡ ¡Ir ¡= ¡Ii ¡• ¡ks ¡• ¡cos ¡θ ¡ ¡ Let’s ¡change ¡the ¡color ¡(ks)! ¡

  • How ¡to ¡represent ¡the ¡color ¡varia9on? ¡
  • Compute ¡a ¡color? ¡(like ¡we ¡did ¡with ¡smoothing) ¡
  • Look ¡up ¡the ¡color ¡in ¡a ¡“database” ¡
slide-11
SLIDE 11

Surface ¡Colora9on: ¡Textures ¡

Compute ¡a ¡color ¡(“procedural” ¡or ¡“solid”) ¡

  • Trace ¡the ¡pixel ¡backwards; ¡build ¡an ¡equa9on? ¡
  • “UV-­‑coordinates” ¡2D ¡posi9on ¡ON ¡the ¡surface ¡
  • Can ¡take ¡surface ¡orienta9on ¡into ¡account ¡
  • Challenge: ¡what’s ¡the ¡func9on ¡for ¡“granite” ¡? ¡
slide-12
SLIDE 12

Surface ¡Colora9on: ¡Textures ¡

Look ¡up ¡a ¡color ¡

  • Exis9ng ¡color ¡databases? ¡ ¡raster ¡images! ¡ ¡
  • Us ¡UV-­‑coordinates ¡to ¡compute ¡row ¡& ¡column ¡
  • Challenge: ¡anisotropic ¡materials ¡
slide-13
SLIDE 13

Surface ¡Colora9on: ¡Textures ¡

  • How ¡does ¡color ¡vary? ¡
  • In ¡paeerns ¡(9le, ¡wallpaper, ¡concrete ¡formwork, ¡etc) ¡
  • Manufactured ¡paeerns ¡usually ¡“9le” ¡
  • Without ¡paeern ¡(stone, ¡wood, ¡wear, ¡dirt, ¡graffi9) ¡
  • Natural ¡paeerns ¡usually ¡don’t ¡9le ¡
  • Anisotropic: ¡Not ¡uniform ¡in ¡all ¡direc9ons ¡
  • Solid ¡wood ¡v. ¡Wood-­‑veneer ¡ ¡
  • Wood ¡grain ¡carries ¡over ¡to ¡rings ¡
slide-14
SLIDE 14

Surface ¡Colora9on: ¡Textures ¡

Procedural ¡(computed) ¡ Image-­‑based ¡(look-­‑up) ¡ ComputaFonally ¡intensive ¡ RAM ¡intensive ¡ No ¡repeats ¡ Repeats ¡ Variable ¡resoluFon ¡ Fixed ¡resoluFon ¡ Solid ¡ Veneer ¡ Hard ¡to ¡make ¡ ¡ Easy ¡to ¡make ¡

Compare ¡& ¡Contrast ¡

slide-15
SLIDE 15

Surface ¡Transparency ¡

  • Adjustment ¡to ¡z-­‑buffer ¡behavior ¡
  • Check ¡pixel ¡transparency ¡as ¡well ¡as ¡z-­‑locaFon ¡
  • Combine ¡surface ¡colors ¡for ¡final ¡appearance ¡
  • “Zero ¡polygon ¡geometry” ¡

– Wire ¡mesh ¡ – Deck ¡rails ¡& ¡handrails ¡on ¡stairs ¡ – Distant ¡openings ¡in ¡walls, ¡etc. ¡

  • Uses ¡image-­‑map ¡alpha ¡channel ¡or ¡B/W ¡image ¡
slide-16
SLIDE 16

Surface ¡Irregulari9es: ¡Bumps ¡

  • Simulates ¡small ¡scale ¡bumps ¡

– Tile ¡grout ¡lines ¡ – Brick ¡mortar ¡lines ¡ – Steel ¡tread ¡plate ¡ – Concrete ¡form ¡lines ¡& ¡form ¡Fes ¡

  • No ¡horizon ¡disturbance ¡
  • Image-­‑based: ¡gray-­‑scale ¡image ¡

controls ¡

slide-17
SLIDE 17

Texture-­‑Surface ¡Alignment ¡

  • Mapping/projecFon ¡type ¡(planar, ¡square, ¡

cylindrical, ¡spherical) ¡

  • Scale ¡
  • Origin ¡
  • OrientaFon ¡
  • N-­‑repeats ¡
  • Mirroring ¡
slide-18
SLIDE 18

Textures ¡as ¡Many ¡Maps ¡

  • Same ¡resoluFon ¡(same ¡# ¡pixels) ¡
  • There ¡may ¡be ¡mulFple ¡map ¡opportuniFes ¡

– Environment ¡(what’s ¡reflected) ¡ – Diffuse ¡color ¡vs. ¡specular ¡color ¡ – Transparency ¡ – Bump ¡ – Displacement ¡

  • Know ¡what ¡they ¡do! ¡
slide-19
SLIDE 19

Example: ¡Transparency ¡Handrails ¡

slide-20
SLIDE 20

Example: ¡One-­‑poly ¡Mike ¡

slide-21
SLIDE 21

Example: ¡Controlling ¡the ¡Smooth ¡

slide-22
SLIDE 22

Example: ¡Ground; ¡Sky; ¡ReflecFon ¡

slide-23
SLIDE 23

Example: ¡Ground; ¡Sky; ¡Trees ¡

slide-24
SLIDE 24

Example: ¡Floor; ¡Carpet; ¡Stone ¡

slide-25
SLIDE 25

Example: ¡Floor; ¡Concrete ¡

slide-26
SLIDE 26

#4: ¡Faux ¡Geometry ¡

Rendering ¡tricks ¡that ¡give ¡the ¡ appearance ¡of ¡geometry. ¡