Texture Sprites: Texture Elements Splatted on Surfaces Sylvain Lefebvre Sylvain Lefebvre Samuel Hornus Samuel Hornus Fabrice Neyret Fabrice Neyret GRAVIR/IMAG-INRIA GRAVIR/IMAG-INRIA ACM SIGGRAPH 2005 Symposium on ACM SIGGRAPH 2005 Symposium on Interactive 3D Graphics and Games 2005 Interactive 3D Graphics and Games 2005
29
Embed
Texture Sprites: Texture Elements Splatted on Surfaces Sylvain Lefebvre Samuel Hornus Fabrice Neyret GRAVIR/IMAG-INRIA ACM SIGGRAPH 2005 Symposium on Interactive.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Texture Sprites: Texture Elements Splatted on Surfaces
Texture Sprites: Texture Elements Splatted on Surfaces
ACM SIGGRAPH 2005 Symposium on ACM SIGGRAPH 2005 Symposium on Interactive 3D Graphics and Games 2005Interactive 3D Graphics and Games 2005
AbstractAbstract
IntroductionIntroduction
• Texturing 3D models with very high resolutions create two major difficulties– Storage cost of high resolution texture maps can
easily exceed the available texture memory– Creating high resolution textures proves to be a
difficult and tedious task
• Lack of representation for textures composed of sparse elements– Wastes a lot of memory– Discontinuities– Flickering due to Z-fighting
IntroductionIntroduction• Texture sprites
– The texture element live on the object surface and can be updated dynamically
• Provides a general and convenient scheme for sprite-based texturing– Homogeneous appearances obtained by overlapping
many sprites– Interactive addition of local details
• Geometry and composite texture are independent– Not require: 1) mesh to conform to any constraint
2) global planar parameterization 3) modify the initial mesh
ContributionsContributions
• A parameterization-free texture representation allowing efficient storage and filtered rendering of composite textures
• An efficient solution to dynamic decal management and animated texture elements
• New appealing texturing effects
• Complete GPU-implementation
Sprite-Based TexturesSprite-Based Textures
• Key idea– Store the sprite attributes (position,
orientation, etc) in a 3D hierarchical structure surrounding the mesh
– Follow the idea of octree textures• The sprites attributes in the leaves of the
hierarchical grid
– The entire data-structure is compact• Many sprites share a same texture pattern • Information is stored only around the surface
Sprite-Based TexturesSprite-Based Textures
• Easy to author– add, drag, drop, change size, and orientation
• The system is very flexible– Sprite ordering is controllable– Sprite overlapping can be mixed
• Each sprite can be independently animated– For instance: react to surface deformations
DifficultiesDifficulties
• How to manage the hierarchical 3D grid on the GPU (fragment program)
• How to use the hierarchical 3D grid to store and retrieve sprites attributes
• How to filter the composite texture and blend overlapping sprites together
3D Hierarchical Grid (in GPU)3D Hierarchical Grid (in GPU)
• Problem– Store the hierarchical grid in texture memory– Retrieve data from the grid at a given 3D
location– (This is implemented in a fragment program)
• We call this structure N N33-tree-tree– N in each dimension– Octree → N = 2– Implementation: N = 4
N3-tree Memory LayoutN3-tree Memory Layout
• Tree structure– Node: indirection grid consisting of N3 cells– Cell content:
(cell type is determined by a flag stored in the A-channel)
• A = 1, data (leaf)• A = ½ , a pointer• A = 0, empty
– Store our structure in a 3D texture called the indirection pool
• Data values and pointer values are stored as RGB-triples
NotationsNotations
• N*N*NN*N*N: resolution of the indirection grid corresponding to each tree nodeeach tree node
• NNll *N*Nll*N*Nll: resolution of virtual 3D grid at level l
• At level l a point M in space ( M [0, 1)3 )
lies in a cell located at
and has a local coordinate
within this cell. We have
l
l
il N
NMM
,
l
l
fl N
NMfracM
)(,
flil MMM ,,
NotationsNotations
• Node are packed in the indirection pool
• S = (Su, Sv, Sw): size of indirection pool
• NSu*NSv*NSw: resolution of the texture hosting the
indirection pool
• A texture value in the indirection pool is indexed by a real valued P [0, 1)3
• P = Pi+Pf
S
SPPi
S
SPfracPf
)(
NotationsNotations
• Pi identifies the node which is stored in the area
• Pi is called the node coordinates
• Pf is the local coordinate of P within the node’s indirection grid
• (!! Packing the cells does not change the local coordinates.)
SPP ii
1,
l
l
fl N
NMfracM
)(,
S
SPfracPf
)( )()( SPfracNMfrac l
SPNM fll
fl ,, S
NMfracP
l
fl
)(,
Equation(1)
Tree LookupTree Lookup
• For rendering, we need to retrieve the data corresponding to a given location M in space (more precisely, on the object surface)– This is done per-pixel in a fragment program
– Start from level 0 in the tree
– At level l let Pl,i be the coordinate of the current node in the indirection pool
– The RGBA value corresponding to M is found in Pl,i at the location Pl,f , obtained by Equation(1)
– AA: in a leaf (return), an empty node (discard) or an internal node (continue to the next level (l+1) )
Implementation DetailsImplementation Details
• To avoid precision issues, and minimize storage requirements we store S‧Pl,i instead of Pl,i in the indirection cells
• S‧Pl,i is an integer– Optimized the encoding: choose the number of bits to
stored in the RGB channels to exactly represent at most S indices
– The values of the pointers do not depend on the size of the indirection pool
Precision LimitationsPrecision Limitations
• The limited precision of 32 bits floating point:– Limit on the depth, resolution, number of nodes of the
hierarchical grid
Managing the Texture SpritesManaging the Texture Sprites
• Each sprite is associated with – various parameters– a bounding volume V defining the spatial limit
of the sprite influence on the composite texture
• Bounding volume V is used to– determine which cells are covered by sprite– detect whether two sprites overlap