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
8ec63581
Commit
8ec63581
authored
May 04, 2011
by
Sebastian Eichelbaum
Browse files
[CHANGE] - final TF construction example. Will be done by a GUI later.
parent
8281c831
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
16 deletions
+8
-16
src/modules/directVolumeRendering/WMDirectVolumeRendering.cpp
...modules/directVolumeRendering/WMDirectVolumeRendering.cpp
+1
-0
src/modules/directVolumeRendering/shaders/WMDirectVolumeRendering-fragment.glsl
...meRendering/shaders/WMDirectVolumeRendering-fragment.glsl
+7
-16
No files found.
src/modules/directVolumeRendering/WMDirectVolumeRendering.cpp
View file @
8ec63581
...
...
@@ -31,6 +31,7 @@
#include <osg/ShapeDrawable>
#include <osg/StateAttribute>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include "../../common/WColor.h"
#include "../../common/WPropertyHelper.h"
...
...
src/modules/directVolumeRendering/shaders/WMDirectVolumeRendering-fragment.glsl
View file @
8ec63581
...
...
@@ -29,7 +29,7 @@
#endif
// This is needed if the modulo operator % is required
//
#extension GL_EXT_gpu_shader4 : enable
#extension GL_EXT_gpu_shader4 : enable
#include "WGEUtils.glsl"
...
...
@@ -130,34 +130,25 @@ vec4 transferFunction( float value )
#ifdef TRANSFERFUNCTION_ENABLED
return
texture1D
(
u_transferFunctionSampler
,
value
);
#else
if
(
isZero
(
value
-
0
.
5
,
0
.
01
)
)
// if not TF has been specified, at least show something
{
return
vec4
(
1
.
0
,
0
.
0
,
0
.
0
,
0
.
1
);
}
else
{
return
vec4
(
0
.
0
);
}
// Example TF
/*
if ( isZero( value - 0.5, 0.005 ) )
if
(
isZero
(
value
-
0
.
5
,
0
.
00
005
)
)
return
vec4
(
0
.
0
);
vec4
c
=
vec4
(
0
.
0
);
if ( value
>
= 0.5 )
if
(
value
<
=
0
.
5
)
{
c = vec4(
1
.0, 0.3
4
,
0.34
, 2.0 * (
value - 0.5
) );
c
=
vec4
(
0
.
0
,
0
.
3
7
,
1
.
0
,
2
.
0
*
(
0
.
5
-
value
)
);
}
else
{
vec4
cols
[
2
];
cols[
1
] = vec4(
0
.0, 0.3
7
,
1.0
, 0.
1
);
cols[
0
] = vec4(
0
.0,
1.0
,
1
.0, 0.
1
);
cols
[
0
]
=
vec4
(
1
.
0
,
0
.
3
4
,
0
.
34
,
0
.
25
);
cols
[
1
]
=
vec4
(
1
.
0
,
0
.
75
,
0
.
0
,
0
.
25
);
int i = int(2.0 * value * 2.0 * 15.0);
int
i
=
int
(
2
.
0
*
(
value
-
0
.
5
)
*
2
.
0
*
15
.
0
);
int
imod
=
i
%
2
;
c
=
cols
[
imod
];
}
return
c
;
*/
#endif
}
...
...
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