Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
f2b3e75a
Commit
f2b3e75a
authored
Mar 06, 2017
by
amandaghassaei
Browse files
fix acos instability
parent
d170663b
Changes
1
Hide whitespace changes
Inline
Side-by-side
index.html
View file @
f2b3e75a
...
...
@@ -250,8 +250,8 @@
vec3
normal2
=
texture2D
(
u_normals
,
normal2Index
).
xyz
;
float
dotNormals
=
dot
(
normal1
,
normal2
);
//normals are already normalized, no need to divide by length
//
if (dotNormals
<
-
0.999
)
dotNormals
=
-
0.999
;
//
else if (dotNormals > 0.999) dotNormals = 0.999;
if
(
dotNormals
<
-
0.999
)
dotNormals
=
-
0.999
;
else
if
(
dotNormals
>
0.999
)
dotNormals
=
0.999
;
float
theta
=
acos
(
dotNormals
);
vec3
creaseVector
=
texture2D
(
u_creaseVectors
,
scaledFragCoord
).
xyz
;
float
sign
=
dot
(
cross
(
normal1
,
normal2
),
creaseVector
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment