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
329a941b
Commit
329a941b
authored
Apr 11, 2011
by
Sebastian Eichelbaum
Browse files
[ADD] - DVR now ignores values with zero-gradient
parent
ddf9ac15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
src/modules/directVolumeRendering/shaders/WMDirectVolumeRendering-fragment.glsl
...meRendering/shaders/WMDirectVolumeRendering-fragment.glsl
+8
-2
No files found.
src/modules/directVolumeRendering/shaders/WMDirectVolumeRendering-fragment.glsl
View file @
329a941b
...
...
@@ -149,7 +149,13 @@ vec4 localIllumination( in vec3 position, in vec4 color )
{
#ifdef LOCALILLUMINATION_PHONG
// get a gradient and get it to world-space
vec3
worldNormal
=
(
gl_ModelViewMatrix
*
vec4
(
getGradient
(
position
),
0
.
0
)
).
xyz
;
vec3
g
=
getGradient
(
position
);
vec3
worldNormal
=
(
gl_ModelViewMatrix
*
vec4
(
g
,
0
.
0
)
).
xyz
;
if
(
length
(
g
)
<
0
.
01
)
{
return
vec4
(
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
);
}
// let the normal point towards the viewer. Technically this would be:
// worldNormal *= sign( dot( worldNormal, vec3( 0.0, 0.0, 1.0 ) ) );
// but as the most of the components in the view vector are 0 we can use:
...
...
@@ -196,7 +202,7 @@ void main()
// First, find the rayEnd point. We need to do it in the fragment shader as the ray end point may be interpolated wrong
// when done for each vertex.
float
totalDistance
=
0
.
0
;
// the maximal distance along the ray until the BBox ends
float
currentDistance
=
0
.
0
;
// accumulated distance along the ray
float
currentDistance
=
0
.
1
;
// accumulated distance along the ray
#ifdef JITTERTEXTURE_ENABLED
// stochastic jittering can help to void these ugly wood-grain artifacts with larger sampling distances but might
...
...
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