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
b2240655
Commit
b2240655
authored
Feb 17, 2010
by
Sebastian Eichelbaum
Browse files
[CHANGE] - done some projection experiements. But still not working properly
parent
2cba2a60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
src/modules/directVolumeRendering/shaders/DVRRaycast.fs
src/modules/directVolumeRendering/shaders/DVRRaycast.fs
+8
-9
src/modules/directVolumeRendering/shaders/DVRRaycast.vs
src/modules/directVolumeRendering/shaders/DVRRaycast.vs
+3
-1
No files found.
src/modules/directVolumeRendering/shaders/DVRRaycast.fs
View file @
b2240655
...
...
@@ -45,8 +45,6 @@ uniform sampler3D tex0;
// Variables
/////////////////////////////////////////////////////////////////////////////
vec3
rayStart
;
/////////////////////////////////////////////////////////////////////////////
// Functions
/////////////////////////////////////////////////////////////////////////////
...
...
@@ -60,12 +58,12 @@ void main()
vec3
curPoint
=
v_rayStart
;
float
value
;
int
i
=
0
;
while
(
i
<
75
0
)
while
(
i
<
30
0
)
{
i
++;
value
=
texture3D
(
tex0
,
curPoint
).
r
;
if
(
value
>=
0
.
275
)
if
(
value
>=
0
.
320
)
{
break
;
}
...
...
@@ -75,15 +73,16 @@ void main()
}
}
if
(
i
>=
75
0
)
if
(
i
>=
30
0
)
{
discard
;
//
discard;
}
gl_FragColor
=
vec4
(
vec3
(
1
.
0
-
i
/
1000
.
0
),
1
.
0
);//
texture3D
(
tex0
,
curPoint
);
gl_FragColor
=
0
.
975
*
(
vec4
(
vec3
(
1
.
0
-
i
/
300
.
0
),
1
.
0
)
+
0
.
2
*
vec4
(
abs
(
v_normal
),
1
.
0
)
);
//gl_FragColor = vec4( v_rayStart, 1.0 );
// gl_FragColor = vec4( abs(v_normal), 1.0 );
//vec3 v_ray2 = v_rayStart - ( gl_ModelViewMatrixInverse * vec4( 0.0, 1.0, 0.0, 1.0 ) ).xyz;
//gl_FragColor = vec4( abs(v_normal), 1.0 );
// gl_FragColor = vec4( v_ray, 1.0 );
}
src/modules/directVolumeRendering/shaders/DVRRaycast.vs
View file @
b2240655
...
...
@@ -62,7 +62,9 @@ void main()
v_rayStart
=
gl_TexCoord
[
0
].
xyz
;
// transform the ray direction to texture space
v_ray
=
-
normalize
(
gl_ModelViewMatrixInverse
*
vec4
(
0
.
0
,
1
.
0
,
0
.
0
,
1
.
0
)
).
xyz
;
v_ray
=
v_rayStart
-
(
gl_ModelViewMatrixInverse
*
vec4
(
0
.
0
,
1
.
0
,
0
.
0
,
1
.
0
)
).
xyz
;
//v_ray = vec4( 0.0, 1.0, 0.0, 1.0 ).xyz;
//v_ray = v_rayStart - normalize( gl_ModelViewMatrixInverse * vec4( gl_Normal, 1.0 ) ).xyz;
// Simply project the vertex
gl_Position
=
ftransform
();
...
...
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