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
PoroCYon
fishypack-trident
Commits
334cc56f
Commit
334cc56f
authored
Mar 29, 2018
by
blackle
Browse files
Make the bottles look less weird
parent
16e28286
Changes
1
Hide whitespace changes
Inline
Side-by-side
glx-xlib-tests/shader.frag
View file @
334cc56f
...
...
@@ -39,7 +39,6 @@ vec3 lightcols[3] = vec3[3](
vec3
(
0
.
1
,
1
.
0
,
1
.
0
)
);
float
smin
(
float
a
,
float
b
,
float
k
)
{
// if (k == 0.0) return min(a,b);
...
...
@@ -49,7 +48,7 @@ float smin( float a, float b, float k )
float
distanceToBottleCurve
(
vec2
point
)
{
float
x
=
point
.
x
*
2
.
5
;
return
point
.
y
-
0
.
1
*
sin
(
x
+
0
.
2
)
+
0
.
05
*
sin
(
2
.
0
*
x
)
+
0
.
0
5
*
sin
(
3
.
0
*
x
);
return
point
.
y
-
0
.
1
*
sin
(
x
+
0
.
6
)
+
0
.
05
*
sin
(
2
.
0
*
x
)
+
0
.
0
4
*
sin
(
3
.
0
*
x
);
}
float
tombstone
(
vec3
point
,
float
w
,
float
l
,
float
h
,
float
s
,
float
s2
)
{
...
...
@@ -74,7 +73,7 @@ vec2 bottle(vec3 point) {
float
dist
=
length
(
point
.
xy
);
float
tops
=
abs
(
point
.
z
-
0
.
05
)
-
0
.
95
;
float
curve
=
distanceToBottleCurve
(
vec2
(
point
.
z
,
dist
-
0
.
3
));
float
curve
=
distanceToBottleCurve
(
vec2
(
point
.
z
,
dist
-
0
.
29
));
curve
+=
min
(
sin
(
atan
(
point
.
y
/
point
.
x
)
*
16
.
0
),
0
.
0
)
*
0
.
001
;
float
shell
=
-
smin
(
-
tops
,
-
curve
,
0
.
2
);
...
...
@@ -93,7 +92,7 @@ vec2 bottle(vec3 point) {
float
lip
=
cylinder
(
point
+
vec3
(
0
.
0
,
0
.
0
,
0
.
73
),
0
.
15
,
0
.
01
,
0
.
01
);
shell
=
min
(
lip
,
shell
);
float
label
=
cylinder
(
point
*
3
.
1
+
vec3
(
0
.
0
,
0
.
0
,
-
0
.
75
),
1
.
0
,
1
.
0
,
0
.
1
)
/
2
.
9
;
float
label
=
cylinder
(
point
*
3
.
1
+
vec3
(
0
.
0
,
0
.
0
,
-
0
.
75
),
1
.
0
5
,
1
.
0
,
0
.
1
)
/
2
.
9
;
return
smatUnion
(
smatUnion
(
vec2
(
shell
,
1
.
0
),
...
...
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