Sei sulla pagina 1di 2

Massive parallelism implementation of cloth simulation using GPU

Knowledge
Aided
Engineering
Manufacturing
and
Related
Technologies
GPGPU Cloth-Simulation
www.kaemart.it For more information Politecnico di Milano - Dipartimento di Meccanica
ASME 2011 WORLD CONFERENCE
ON INNOVATIVE VIRTUAL REALITY
Introduction and Motivation
Cloth simulation is a great deal of
research for apparel
manufacturers, because it can
provide them a preview of the
final product avoiding the tailoring
of the real garment.
One of the most common
approaches in cloth simulation is
to model the fabric as a
deformable surface composed of
a network of masses and springs,
and to perform the garment
simulation by solving the model
equations.
Francesco Caruso
Assistant Professor at Department of Mechanical Engineering
Politecnico di Milano
francesco.caruso@polimi.it
Abstract
One of the most effective
approaches to achieve cloth
simulation is the particle-based
approach, in which cloth is
described as a set of masses
linked each other through
damped springs. In this way the
cloth behavior is described as a
mechanism of discrete parts. As
all particle-based simulation
systems, cloth simulation fits very
well to be computed on GPU
hardware, achieving good
performances.
Since a piece of fabric is naturally
defined by weft and warp
directions, then structured grids
can be efficiently employed for
cloth simulation. Moreover,
structured grids are appropriate
better than unstructured grids for
GPU hardware, because first
threads are batched and indexed
in a rectilinear grids and second
because accesses to global
memory can be optimized (and
coalesced) by exploiting locality.
The main bottleneck is
represented by the data transfer
between GPU and CPU.
Mathematical Model & Algorithm
In the adopted model there are
stretching, bending and shearing
springs. It is possible to model the
anisotropic behavior of the cloth by
varying spring constants, like depicted
in Fig 3, where two different kind of
fabrics, the stiffer on the right, and the
weaker on the left, are simulated. The
algorithm for the computation is
described in fig. 1. Since a piece of
fabric is naturally defined by weft and
warp directions, then structured grids
can be efficiently employed for cloth
simulation.
KAEMaRT
Implementation on parallel
hardware
Since each particle can be
computed indipendently from the
others, this problem fits well to be
implemented on parallel hardware.
In each simulation step, a data
transfer from the central memory
to the GPU memory is required
(Fig 2). Like depicted in Fig 5,
performance benefits due to
parallelization increase as the
mesh dimension grows
Fig. 1 Simulatin Loop
rollng - Slmulauon Loop
parucles
CompuLauon umes for one lLerauon ln mllll-seconds
Slmulauon Loop
0
10
20
30
40
30
60
70
80
32x32 64x64 128x128
colllslon
response
colllslon
deLecuon
predlcL
uncosLralned
mouon
!"#$%&'()*"+,#-&.##/&
0123(4$&*-4#-5$1+(-23
)#,#-&
!#""(5(#- 62$24,#-
!#""(5(#- 725/#-52
!"
#"
$"
%"
&"
'!"
'#"
'$"
(#)(#" %$)%$" '#&)'#&"
*+*,-."
/-012+-"
3,*45678"
40-639+1"
:-+;<3/"=73,71/-0<7+;">,6,7"
:-,?9<78"@":-+;<3/"=73,71/-0<7+;">,6,7"
!"#"$%&'(&)*+&,-./0/&1*+&
2.-3"45&0$4'$/5.6"$-3&#'7'$&/5-2&
8&
9&
:&
;&
<&
=&
>&
?&
;:@;:& ><@><& 9:A@9:A&
)*+&
1*+&
1'#20567'$&7#-/&('.&'$-&"5-.67'$&"$&#"BB"C/-4'$3/&
Fig. 1 Simulatin
Loop
Fig. 3 Simulatin of fabrics with different stiffness
Results and Drawbacks
Benefits of GPU implementation
are clear, however, collision
detection is running on CPU.
It represents the main bottleneck
of the whole implementation,
mainly because particle system
data have to be transfered from
the GPU memory to the CPU
memory (Fig 2). Collision
detection is running on CPU, and
it represents one of the bottleneck
of the whole implementation,
mainly because particle system
data have to be transfered from
the GPU memory to the CPU
memory (Fig 6)
!"#$%&'()*&+*,'"-%*#$(.+/+*(+*(0!)(
)1$-'#(2+,'3%$#(
4-'-3'"5&'5"#(
6+17(4-'-3'"5&'5"#('+(
0!)(
6+815'#(*#9(1+,%/+*,(
6+17(&+815'#$($-'-('+(
':#(:+,'(
Fig. 2
memory transfers
diagram
Fig. 4 Profiling of the Simulatin Loop
Fig. 5 GPU vs CPU benchmark
Fig. 6 Memory transfers benchmark (ms)
Massive parallelism implementation of cloth simulation using GPU
Knowledge
Aided
Engineering
Manufacturing
and
Related
Technologies
GPGPU Cloth-Simulation
www.kaemart.it For more information Politecnico di Milano - Dipartimento di Meccanica
ASME 2011 WORLD CONFERENCE
ON INNOVATIVE VIRTUAL REALITY
Introduction and Motivation
Cloth simulation is a great deal of
research for apparel
manufacturers, because it can
provide them a preview of the
final product avoiding the tailoring
of the real garment.
One of the most common
approaches in cloth simulation is
to model the fabric as a
deformable surface composed of
a network of masses and springs,
and to perform the garment
simulation by solving the model
equations.
Francesco Caruso
Assistant Professor at Department of Mechanical Engineering
Politecnico di Milano
francesco.caruso@polimi.it
Abstract
One of the most effective
approaches to achieve cloth
simulation is the particle-based
approach, in which cloth is
described as a set of masses
linked each other through
damped springs. In this way the
cloth behavior is described as a
mechanism of discrete parts. As
all particle-based simulation
systems, cloth simulation fits very
well to be computed on GPU
hardware, achieving good
performances.
Since a piece of fabric is naturally
defined by weft and warp
directions, then structured grids
can be efficiently employed for
cloth simulation. Moreover,
structured grids are appropriate
better than unstructured grids for
GPU hardware, because first
threads are batched and indexed
in a rectilinear grids and second
because accesses to global
memory can be optimized (and
coalesced) by exploiting locality.
The main bottleneck is
represented by the data transfer
between GPU and CPU.
Mathematical Model & Algorithm
In the adopted model there are
stretching, bending and shearing
springs. It is possible to model the
anisotropic behavior of the cloth by
varying spring constants, like depicted
in Fig 3, where two different kind of
fabrics, the stiffer on the right, and the
weaker on the left, are simulated. The
algorithm for the computation is
described in fig. 1. Since a piece of
fabric is naturally defined by weft and
warp directions, then structured grids
can be efficiently employed for cloth
simulation.
KAEMaRT
Implementation on parallel
hardware
Since each particle can be
computed indipendently from the
others, this problem fits well to be
implemented on parallel hardware.
In each simulation step, a data
transfer from the central memory
to the GPU memory is required
(Fig 2). Like depicted in Fig 5,
performance benefits due to
parallelization increase as the
mesh dimension grows
Fig. 1 Simulatin Loop
rollng - Slmulauon Loop
parucles
CompuLauon umes for one lLerauon ln mllll-seconds
Slmulauon Loop
0
10
20
30
40
30
60
70
80
32x32 64x64 128x128
colllslon
response
colllslon
deLecuon
predlcL
uncosLralned
mouon
!"#$%&'()*"+,#-&.##/&
0123(4$&*-4#-5$1+(-23
)#,#-&
!#""(5(#- 62$24,#-
!#""(5(#- 725/#-52
!"
#"
$"
%"
&"
'!"
'#"
'$"
(#)(#" %$)%$" '#&)'#&"
*+*,-."
/-012+-"
3,*45678"
40-639+1"
:-+;<3/"=73,71/-0<7+;">,6,7"
:-,?9<78"@":-+;<3/"=73,71/-0<7+;">,6,7"
!"#"$%&'(&)*+&,-./0/&1*+&
2.-3"45&0$4'$/5.6"$-3&#'7'$&/5-2&
8&
9&
:&
;&
<&
=&
>&
?&
;:@;:& ><@><& 9:A@9:A&
)*+&
1*+&
1'#20567'$&7#-/&('.&'$-&"5-.67'$&"$&#"BB"C/-4'$3/&
Fig. 1 Simulatin
Loop
Fig. 3 Simulatin of fabrics with different stiffness
Results and Drawbacks
Benefits of GPU implementation
are clear, however, collision
detection is running on CPU.
It represents the main bottleneck
of the whole implementation,
mainly because particle system
data have to be transfered from
the GPU memory to the CPU
memory (Fig 2). Collision
detection is running on CPU, and
it represents one of the bottleneck
of the whole implementation,
mainly because particle system
data have to be transfered from
the GPU memory to the CPU
memory (Fig 6)
!"#$%&'()*&+*,'"-%*#$(.+/+*(+*(0!)(
)1$-'#(2+,'3%$#(
4-'-3'"5&'5"#(
6+17(4-'-3'"5&'5"#('+(
0!)(
6+815'#(*#9(1+,%/+*,(
6+17(&+815'#$($-'-('+(
':#(:+,'(
Fig. 2
memory transfers
diagram
Fig. 4 Profiling of the Simulatin Loop
Fig. 5 GPU vs CPU benchmark
Fig. 6 Memory transfers benchmark (ms)

Potrebbero piacerti anche