Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Brave 2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Börcsök Barnabás
Brave 2
Commits
cd6599ce
Commit
cd6599ce
authored
Dec 10, 2020
by
bobarna
Browse files
Options
Downloads
Patches
Plain Diff
spellcheck
parent
e1f115c7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/documentation.tex
+32
-32
32 additions, 32 deletions
docs/documentation.tex
docs/spellcheck.sh
+2
-0
2 additions, 0 deletions
docs/spellcheck.sh
with
34 additions
and
32 deletions
docs/documentation.tex
+
32
−
32
View file @
cd6599ce
...
...
@@ -132,12 +132,12 @@ graphics, it came naturally to choose a subject in this area. As I had little
hands-on experience in this field, a long time had to be dedicated
to research and trying out different simulation methods.
The first of this paper reflects this, giving an overview of considered
methods,
and other possible routes that could have been taken to implement hair
The first
part
of this paper reflects this, giving an overview of considered
methods,
and other possible routes that could have been taken to implement hair
simulation.
The implementation and all of the code mentioned is avaiable at
The implementation and all of the code mentioned is avai
l
able at
\url
{
http://git.sch.bme.hu/bobarna/brave-2
}
.
\section
{
Overview of considered methods
}
...
...
@@ -154,7 +154,7 @@ movie Brave.
This approach models the hair as a chain of particles with given mass, each
connected via springs. This results in a mass-spring system, which is then
model
l
ed by considering well-known physics formula's such as Newton's second law
modeled by considering well-known physics formula's such as Newton's second law
of motion
$
F
=
m
*
a
$
, and Hooke's Law, which states that the force
$
F
$
needed to extend or compress a spring by some distance
$
x
$
scales linearly with
respect to that distance. The paper by
\citet
{
PixarPaper
}
created an elaborate
...
...
@@ -192,7 +192,7 @@ to control to behaviour of such a system -- which is present in both papers.
\subsection
{
Follow-the-Leader (FTL)
}
The Dynamic Follow-the-Leader (FTL) method outlined
in
\citet
{
FTLHair
}
focuses
The Dynamic Follow-the-Leader (FTL) method outlined
by
\citet
{
FTLHair
}
focuses
on the fast simulation of hair and fur on animated characters. The sheer number
of computation needed for simulating thousands of hair strands, each consisting
of numerous particles presents a big challenge. Also, as each strand is
...
...
@@ -221,12 +221,12 @@ implementation to eliminate the stretching in the presence of greater forces.
\subsection
{
Algorithm Overview
}
\label
{
section:algorithmOverview
}
We model an
$
S
$
hair strand as a chain of
$
N
$
particles and a set of
$
M
$
constraints. Each particle
$
p
\in
[
1
,
\ldots
,N
]
$
has three atributes: mass (
$
m
_
p
$
), position
constraints. Each particle
$
p
\in
[
1
,
\ldots
,N
]
$
has three at
t
ributes: mass (
$
m
_
p
$
), position
(
$
\boldsymbol
{
x
_
p
}$
) and velocity (
$
\boldsymbol
{
v
_
p
}$
).
A constraint
$
c
\in
[
1
,
\ldots
,M
]
$
with cardinality
$
n
_
c
$
is a function
$
C
_
c
:
\mathbb
{
R
}
^{
3
n
_
c
}
\mapsto
\mathbb
{
R
}$
. It operates on a set of indices
$
\{
i
_
1
,
\ldots
i
_{
n
_
c
}
\}
, i
_
k
\in
[
1
,...,N
]
$
. The constraint funtion also has a stiffnes
i
_{
n
_
c
}
\}
, i
_
k
\in
[
1
,...,N
]
$
. The constraint fun
c
tion also has a stiffnes
s
parameter
$
k
_
c
\in
[
0
...
1
]
$
and a type of either
\emph
{
equality
}
or
\emph
{
inequality
}
.
...
...
@@ -301,7 +301,7 @@ Euler integration step. In line \lineRefSingle{16} the iterative solver manipula
these temporary position estimates such that they satisfy the constraints. It
does this by repeatedly projecting each constraint in an iterative manner to
similar to that of a Gauss-Seidel
\footnote
{
url
{
https://en.wikipedia.org/wiki/Gauss
\%
E2
\%
80
\%
93Seidel
\_
method
}}
\footnote
{
\
url
{
https://en.wikipedia.org/wiki/Gauss
\%
E2
\%
80
\%
93Seidel
\_
method
}}
solver
\emph
{
(see section
\ref
{
sec:solver
}
)
}
. Once the solver finishes with the
iterations, in lines
\lineRef
{
19
}{
20
}
each particle is moved to the calculated
(once temporary) positions, and the velocity of each particle is updated
...
...
@@ -313,7 +313,7 @@ Velocities are manipulated in lines \lineRefSingle{6}, \lineRefSingle{8} and
Line
\lineRefSingle
{
6
}
allows to account for external forces
in the simulation if some of the forces cannot be converted to positional
constraints.
\emph
{
(For example the pulling force between subsequent particles
are model
l
ed as distance constraints instead of external forces, and so are the
are modeled as distance constraints instead of external forces, and so are the
forces generated by the particles colliding with other objects.)
}
We use it to
add gravity, and to generate wind effects for demonstration purposes. If only
the gravitational force is present, then the line becomes
$
\b
{
p
_
v
}
\gets
\b
{
p
_
v
}
...
...
@@ -327,10 +327,10 @@ between $98\%$ to $99.9\%$ seemed to be a good enough solution.
The initial constraints
$
C
_
1
,
\ldots
, C
_
M
$
are fixed throughout the simulation.
In addition to these initial constraints, line
\lineRefSingle
{
13
}
generates additional
$
M
_{
coll
}$
collisi
ti
on constrants. These change from time step to time step. The
$
M
_{
coll
}$
collision constra
i
nts. These change from time step to time step. The
projection step in line
\lineRefSingle
{
16
}
considers both the fixed and the
collision constraints. Our implementation does not yet utilize this opportunity
to dynamicaly generate collision constraints. This is one of the possible future
to dynamical
l
y generate collision constraints. This is one of the possible future
works outlined in the subsection
\nameref
{
subsec:future
_
work
_
collision
}
.
\subsection
{
The Solver
}
...
...
@@ -351,7 +351,7 @@ method: we repeatedly iterate through all the constraints and project the
particles to valid locations with respect to the given constraint alone.
Modifications to point locations immediately get visible to the process. This
speeds up convergence significantly, because pressure waves can propagate
throught the chain of particles in a single solver step, and effect which is
through
ou
t the chain of particles in a single solver step, and effect which is
dependent on the order in which constraints are solved.
In our hair simulation case, we solve the distance constraints by putting the
...
...
@@ -366,10 +366,10 @@ Section \ref{section:DistanceConstraint} \nameref{section:DistanceConstraint}.
There are several ways of incorporating the stiffness parameter. The simplest
-- and the way we chose to utilize -- is simply multiplying the
$
\Delta
\b
{
p
}$
correction by the
$
k
\in
[
0
\ldots
1
]
$
stiffness paramter. For multiple
correction by the
$
k
\in
[
0
\ldots
1
]
$
stiffness param
e
ter. For multiple
iteration loops of the solver, the effect of
$
k
$
becomes non-linear. The
re
a
mining error after
$
n
_
s
$
solver iterations is
$
\Delta
\b
{
p
}
(
1
-
k
)
^{
n
_
s
}$
.
\citet
{
MullerPBD
}
propose
s
to multiply the corrections not by
$
k
$
directly, but
rem
a
ining error after
$
n
_
s
$
solver iterations is
$
\Delta
\b
{
p
}
(
1
-
k
)
^{
n
_
s
}$
.
\citet
{
MullerPBD
}
propose to multiply the corrections not by
$
k
$
directly, but
by
$
k'
=
1
-
(
1
-
k
)
^{
1
/
n
_
s
}$
. With this transformation, the error becomes
$
\Delta
\b
{
p
}
(
1
-
k'
)
^{
n
_
s
}
=
\Delta\b
{
p
}
(
1
-
k
)
$
, and thus linearly dependent on
$
k
$
and
independent of
$
n
_
s
$
. The resulting stiffness is still dependent on the time
...
...
@@ -455,7 +455,7 @@ straight forward: we move both by $\b{p_1}$ and $\b{p_2}$ by $\Delta \b{p_1}$ an
$
\Delta
\b
{
p
_
2
}$
respectively.
\subsection
{
Bending Constraint
}
\label
{
section:bendingConstraint
}
\citet
{
UmenhofferSimulation
}
use
s
the PBD technique to simulate cloth materials.
\citet
{
UmenhofferSimulation
}
use the PBD technique to simulate cloth materials.
They utilize the bending constraint to define the bending resistance of the
material, giving it an extra stiffness. Their goal with the Bending Constraint
is to keep an initial angle between adjacent triangles formed by particles. They
...
...
@@ -523,12 +523,12 @@ into the specifics we settled on for our hair simulation.
The code is available at
\url
{
http://git.sch.bme.hu/bobarna/brave-2
}
.
\subsection
{
Data
s
tructures
}
\subsection
{
Data
S
tructures
}
The properties of particles introduced in chapter
\ref
{
section:algorithmOverview
}
\nameref
{
section:algorithmOverview
}
got an additional color property. This is
decision was made so hair with a gradient color
could be simulated.
\ref
{
section:algorithmOverview
}
\nameref
{
section:algorithmOverview
}
got an
additional color property. This decision was made so hair with a gradient color
could be simulated.
\begin{verbatim}
class Particle
{
...
...
@@ -548,13 +548,13 @@ performance of operations and function calls.
\subsection
{
Constraints
}
A
\texttt
{
Constraint
}
class with an abstract
\texttt
{
solve()
}
method was
implemented, storing each derived constraint class
\emph
{
(e.g.
PositionConstraint, BendingConstraint)
}
in a heterogen
PositionConstraint, BendingConstraint)
}
in a heterogen
eous
collection and calling each overriden
\texttt
{
solve()
}
method when projecting
the constraints in the iteration loop (line
\lineRefSingle
{
16
}
of Algorithm
\ref
{
alg:pbd
}
).
This implementation proved to be not fast enough, lagging even with low particle
counts. We could not discover the cause of this increased comput
ing
time, and
counts. We could not discover the cause of this increased comput
ational
time, and
decided to settle on another solution. Instead of the above mentioned, we
store only the parameters that constraints operate on, and the simulation calls
the relevant solve functions with these stored parameters.
...
...
@@ -596,7 +596,7 @@ After investigating and trying out multiple methods to simulate hair, we arrived
at the Position Based Dynamics (PBD) method. An overview of the PBD method, and
an introduction to the constraint types used in our implementation was given.
An implementation was made in C++ and OpenGL, which easily simulates the hair
strands in real time, although the limit of the real-time
nature
can easily be
strands in real time, although the limit of the real-time
method
can easily be
surpassed when adding around a thousand strands each with more than 30
particles.
...
...
@@ -609,10 +609,10 @@ desired aspects of the simulation.
\subsection
{
Hair-hair Collisions
}
\label
{
subsec:future
_
work
_
collision
}
As it is computationally ex
t
ensive to simulate each particle colliding with all
As it is computationally ex
p
ensive to simulate each particle colliding with all
of the other particles, a particle density field could be used. One such method
of grouping hair particles and their corresponding velocities into a 3D voxel
grid is outlined in the
\citet
{
PixarVolumetricHair
}
paper
, which was also
grid is outlined in the
paper by
\citet
{
PixarVolumetricHair
}
, which was also
utilized in the
\citet
{
FTLHair
}
paper for handling hair-hair collisions.
Such a method could be used to dynamically generate collision constraints in
line
\lineRefSingle
{
13
}
of Algorithm~
\ref
{
alg:pbd
}
.
...
...
@@ -704,11 +704,11 @@ asd
\label
{
section:appendixOBJ
}
An OBJ reader utility was implemented as part of the project. As the OBJ file
format
\footnote
{
\url
{
http://paulbourke.net/dataformats/obj/
}}
describes a wide
range
of properties for objects, our OBJ reader handles only the subset of
these
description options -- those that are needed for the project.
Not
supported line
types were simply ignored, still resulting in
a successful file read if
possible.
format
\footnote
{
\url
{
http://paulbourke.net/dataformats/obj/
}}
describes a wide
range
of properties for objects, our OBJ reader handles only the subset of
these
description options -- those that are needed for the project.
Unsupported line
types were simply ignored, still resulting in
a successful file read if
possible.
\begin{table}
[htb]
\caption
{
Supported OBJ Data Types
}
...
...
@@ -760,7 +760,7 @@ face definitions of the above format.}}
\subsection
{
Recording the simulation on-the-fly
}
A recording utility was made to work in tandem with the application. In essence,
the rendered images are written into
\texttt
{
bmp
}
or
\texttt
{
png
}
files if the
capturing is
on
. In the
capturing is
enabled
. In the
implementation
\footnote
{
\url
{
https://git.sch.bme.hu/bobarna/brave-2
}}
, toggling
the capturing is mapped to the
\texttt
{
C
}
key.
...
...
@@ -777,7 +777,7 @@ the frame with left-padded zeroes.
After the image files are written, the user can start the
\texttt
{
make
\_
video.sh
}
script to assemble the
\texttt
{
output.mp4
}
and delete
all the rendered frames. This script uses the free and open-sorce ffmpeg command
all the rendered frames. This script uses the free and open-so
u
rce ffmpeg command
line utility
\footnote
{
\url
{
https://ffmpeg.org/
}}
...
...
This diff is collapsed.
Click to expand it.
docs/spellcheck.sh
0 → 100755
+
2
−
0
View file @
cd6599ce
#!/usr/bin/sh
hunspell
-d
en_US
-l
documentation.tex
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment