pattern based procedural textures sylvain lefebvre fabrice neyret imagis - gravir / imag - inria

37
attern Based Procedural Texture Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA http://www-imagis.imag.fr/Membres/Sylvain.Lefebvre/pattern

Upload: britney-chapman

Post on 03-Jan-2016

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Pattern Based Procedural Textures

Sylvain Lefebvre Fabrice Neyret

iMAGIS - GRAVIR / IMAG - INRIA

http://www-imagis.imag.fr/Membres/Sylvain.Lefebvre/pattern

Page 2: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Overview

• Motivations

• Previous Work

• Contributions

• Our Framework– Case study– Results

• Conclusion

Page 3: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Motivations

• Texturing large areas– Landscapes in simulators– Video games

• Requirements

High resolution and low memory cost

Avoiding periodicity

User control

Page 4: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Previous work

• Large explicit texture

• Extensions– Clipmaps [Tanner et al. 98]– Texture Compression– Empty space compression [Kraus Ertl 02]

• Drawbacks– Memory cost– Lossy Compression

Page 5: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Previous work

• Procedural textures– [Perlin 85] [Worley 96] [Ebert 94]

• Drawbacks– Calculation cost– Control by the artist uneasy– Not all materials

Page 6: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Previous work

• Pattern based texturing– Aperiodic tiling [Stam 97]– Triangular patterns [Neyret Cani 99]– Virtual atlases [Soler 02]– Sparse convolutions [Lewis 89, Erbert 94]

• Drawbacks– Mesh dependency– Local variations uneasy

Page 7: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Previous work

• Pattern based texturing– Aperiodic tiling [Stam 97]– Triangular patterns [Neyret Cani 99]– Virtual atlases [Soler 02]– Sparse convolutions [Lewis 89, Erbert 94]

• Drawbacks– Mesh dependency– Local variations uneasy

Page 8: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Previous work

• Pattern based texturing– Aperiodic tiling [Stam 97]– Triangular patterns [Neyret Cani 99]– Virtual atlases [Soler 02]– Sparse convolutions [Lewis 89, Erbert 94]

• Drawbacks– Mesh dependency– Local variations uneasy

Page 9: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Contributions

• Framework for creating very large virtual textures by combining patterns– No constraint on mesh (texture space)– Low memory cost

• Runs on today graphics hardware

• As generic as possible

Page 10: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Method overview

Texture coordinates pattern

Texture space

(u,v)

Page 11: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Method overview

Texture coordinates pattern color

Texture space

(u,v)

color

Page 12: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Method overview

Texture coordinates pattern color

Texture space

(u,v)

color

Page 13: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Method overview

Texture coordinates color

Corresponds to hardware fragment program

CPU

Software Vertex Program

Rasterisation

Interpolation

FragmentProgram

Tests & Blending

Matrices, lights, …

Textures Frame Buffer

Programmable Graphics Hardware

Page 14: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Our Framework

• Set of basic blocks

• 1 block = 1 functionality

• Textures by combining blocks

Page 15: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Overview

• Motivations

• Previous Work

• Contributions

• Our Framework– Case study– Results

• Conclusion

Page 16: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Case study

• Aperiodic tiling– NxN virtual cells– TxT patterns– 3 blocks

Virtual Tile

Map Virtual Indirection Map

Reference

Texture

uglob colorutile

g p

T N N T

Page 17: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Aperiodic tiling

• Virtual Tile Map– cell index g

– relative coordinates utile

Virtual Tile

Map Virtual Indirection Map

Reference

Texture

uglob colorutile

g p

T N N T

uglob

utile

g g+1g-1

Page 18: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Aperiodic tiling

• Virtual Indirection Map– random index p from g (aperiodic)– uses permutation table

Virtual Tile

Map Virtual Indirection Map

Reference

Texture

uglob colorutile

g p

T N N T

)))(((2

gT

g

T

gp

Page 19: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Aperiodic tiling

• Reference Texture

Virtual Tile

Map Virtual Indirection Map

Reference

Texture

uglob colorutile

g p

T N N T

p

utile

color

Page 20: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Aperiodic tiling

Virtual Tile

Map Virtual Indirection Map

Reference

Texture

uglob colorutile

g p

T N N T

Page 21: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Blocks

– Pattern choice and positioning

– Transitions between neighboring patterns

– Animation

Page 22: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Blocks

– Pattern choice and positioning

– Transitions between neighboring patterns

– Animation

Page 23: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Blocks

– Pattern choice and positioning

– Transitions between neighboring patterns

– Animation

Page 24: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Overview

• Motivations

• Previous Work

• Contributions

• Our Framework– Case study– Results

• Conclusion

Page 25: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Probability distribution control

• Areas mapInterpolation of probabilities

Page 26: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Probability distribution control

• Areas mapInterpolation of probabilities

Virtual resolution = 4096 ²

Page 27: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Transitions

Textures from Warcraft ® III: Reign of Chaos™

© Blizzard Entertainment ®. All rights reserved.only one quad

Page 28: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Transitions

only one quadTextures from Warcraft ® III: Reign of Chaos™

© Blizzard Entertainment ®. All rights reserved.

Page 29: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Random positioning

Page 30: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Animations

Page 31: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Animations

Using explicit positonning

Memory cost = pattern + 16x16 positionning map

Page 32: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Performances

1.1 fps8.5 fps15.5 fps24.5 fps640x480

5 fps36 fps73 fps113 fps320x200

391075Tex. lookups

512 instr.117 instr.65 instr.56 instr.Code length

Dithered Areas Map & transitions

Dithered Areas Map

Areas mapAperiodic tiling

• Measures on GeForce FX prototype (half speed)• 32 bits precision• texture covers full screen

Page 33: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Filtering

• MIP – mapping

• Close view point– Linear interpolation

• Far view point– Indirection average color

• Issue in general with indirections

Page 34: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Conclusion

• Framework• Runs on hardware• Allows very large aperiodic textures• Low memory cost

Filtering issue Exploiting the framework Tiling with edge constraints

Page 35: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Acknoledgements

• NVidia for the GeForce FX prototype• Blizzard Entertainment for texture data

Page 36: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Thank you !

Questions ?

http://www-imagis.imag.fr/Membres/Sylvain.Lefebvre/pattern

Page 37: Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA

Pattern Based Procedural Textures

Sylvain Lefebvre Fabrice Neyret

iMAGIS - GRAVIR / IMAG - INRIA

http://www-imagis.imag.fr/Membres/Sylvain.Lefebvre/pattern