Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
07623160
Commit
07623160
authored
Apr 09, 2010
by
Alexander Wiebel
Browse files
[ADD] forgot this change
parent
febc633d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
14 deletions
+35
-14
src/modules/marchingCubes/shaders/surface.fs
src/modules/marchingCubes/shaders/surface.fs
+35
-14
No files found.
src/modules/marchingCubes/shaders/surface.fs
View file @
07623160
varying
vec4
VaryingTexCoord0
;
varying
vec4
VaryingTexCoord1
;
varying
vec4
VaryingTexCoord2
;
varying
vec4
VaryingTexCoord3
;
varying
vec4
VaryingTexCoord4
;
varying
vec4
VaryingTexCoord5
;
varying
vec4
VaryingTexCoord6
;
varying
vec4
VaryingTexCoord7
;
varying
vec4
VaryingTexCoord8
;
varying
vec4
VaryingTexCoord9
;
uniform
bool
useLighting
;
uniform
bool
useTexture
;
...
...
@@ -49,25 +58,37 @@ uniform float alpha7;
uniform
float
alpha8
;
uniform
float
alpha9
;
uniform
int
useCmap0
;
uniform
int
useCmap1
;
uniform
int
useCmap2
;
uniform
int
useCmap3
;
uniform
int
useCmap4
;
uniform
int
useCmap5
;
uniform
int
useCmap6
;
uniform
int
useCmap7
;
uniform
int
useCmap8
;
uniform
int
useCmap9
;
#
include
"colorMaps.fs"
#
include
"lighting.fs"
void
lookupTex
(
inout
vec4
col
,
in
int
type
,
in
sampler3D
tex
,
in
float
threshold
,
in
vec3
v
,
in
float
alpha
)
void
lookupTex
(
inout
vec4
col
,
in
int
type
,
in
sampler3D
tex
,
in
float
threshold
,
in
vec3
v
,
in
float
alpha
,
in
int
cmap
)
{
vec3
col1
=
vec3
(
0
.
0
);
col1
=
clamp
(
texture3D
(
tex
,
v
).
rgb
,
0
.
0
,
1
.
0
);
if
(
(
col1
.
r
+
col1
.
g
+
col1
.
b
)
/
3
.
0
-
threshold
<=
0
.
0
)
return
;
if
(
(
col1
.
r
+
col1
.
g
+
col1
.
b
)
/
3
.
0
-
threshold
<=
0
.
0
)
return
;
if
(
type
==
16
&&
useColorM
ap
!=
-
1
)
if
(
cm
ap
!=
0
)
{
if
(
threshold
<
1
.
0
)
{
col1
.
r
=
(
col1
.
r
-
threshold
)
/
(
1
.
0
-
threshold
);
}
colorMap
(
col1
,
col1
.
r
,
useColorM
ap
);
colorMap
(
col1
,
col1
.
r
,
cm
ap
);
}
col
.
rgb
=
mix
(
col
.
rgb
,
col1
.
rgb
,
alpha
);
...
...
@@ -86,16 +107,16 @@ void main()
if
(
useTexture
)
{
if
(
type9
>
0
)
lookupTex
(
col
,
type9
,
tex9
,
threshold9
,
VaryingTexCoord
0
.
xyz
,
alpha9
);
if
(
type8
>
0
)
lookupTex
(
col
,
type8
,
tex8
,
threshold8
,
VaryingTexCoord
0
.
xyz
,
alpha8
);
if
(
type7
>
0
)
lookupTex
(
col
,
type7
,
tex7
,
threshold7
,
VaryingTexCoord
0
.
xyz
,
alpha7
);
if
(
type6
>
0
)
lookupTex
(
col
,
type6
,
tex6
,
threshold6
,
VaryingTexCoord
0
.
xyz
,
alpha6
);
if
(
type5
>
0
)
lookupTex
(
col
,
type5
,
tex5
,
threshold5
,
VaryingTexCoord
0
.
xyz
,
alpha5
);
if
(
type4
>
0
)
lookupTex
(
col
,
type4
,
tex4
,
threshold4
,
VaryingTexCoord
0
.
xyz
,
alpha4
);
if
(
type3
>
0
)
lookupTex
(
col
,
type3
,
tex3
,
threshold3
,
VaryingTexCoord
0
.
xyz
,
alpha3
);
if
(
type2
>
0
)
lookupTex
(
col
,
type2
,
tex2
,
threshold2
,
VaryingTexCoord
0
.
xyz
,
alpha2
);
if
(
type1
>
0
)
lookupTex
(
col
,
type1
,
tex1
,
threshold1
,
VaryingTexCoord
0
.
xyz
,
alpha1
);
if
(
type0
>
0
)
lookupTex
(
col
,
type0
,
tex0
,
threshold0
,
VaryingTexCoord0
.
xyz
,
alpha0
);
if
(
type9
>
0
)
lookupTex
(
col
,
type9
,
tex9
,
threshold9
,
VaryingTexCoord
9
.
xyz
,
alpha9
,
useCmap9
);
if
(
type8
>
0
)
lookupTex
(
col
,
type8
,
tex8
,
threshold8
,
VaryingTexCoord
8
.
xyz
,
alpha8
,
useCmap8
);
if
(
type7
>
0
)
lookupTex
(
col
,
type7
,
tex7
,
threshold7
,
VaryingTexCoord
7
.
xyz
,
alpha7
,
useCmap7
);
if
(
type6
>
0
)
lookupTex
(
col
,
type6
,
tex6
,
threshold6
,
VaryingTexCoord
6
.
xyz
,
alpha6
,
useCmap6
);
if
(
type5
>
0
)
lookupTex
(
col
,
type5
,
tex5
,
threshold5
,
VaryingTexCoord
5
.
xyz
,
alpha5
,
useCmap5
);
if
(
type4
>
0
)
lookupTex
(
col
,
type4
,
tex4
,
threshold4
,
VaryingTexCoord
4
.
xyz
,
alpha4
,
useCmap4
);
if
(
type3
>
0
)
lookupTex
(
col
,
type3
,
tex3
,
threshold3
,
VaryingTexCoord
3
.
xyz
,
alpha3
,
useCmap3
);
if
(
type2
>
0
)
lookupTex
(
col
,
type2
,
tex2
,
threshold2
,
VaryingTexCoord
2
.
xyz
,
alpha2
,
useCmap2
);
if
(
type1
>
0
)
lookupTex
(
col
,
type1
,
tex1
,
threshold1
,
VaryingTexCoord
1
.
xyz
,
alpha1
,
useCmap1
);
if
(
type0
>
0
)
lookupTex
(
col
,
type0
,
tex0
,
threshold0
,
VaryingTexCoord0
.
xyz
,
alpha0
,
useCmap0
);
}
if
(
useLighting
)
col
=
col
+
(
ambient
*
col
/
2
.
0
)
+
(
diffuse
*
col
)
+
(
specular
*
col
/
2
.
0
);
...
...
Write
Preview
Markdown
is supported
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