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
204f5aac
Commit
204f5aac
authored
Dec 14, 2011
by
Sebastian Eichelbaum
Browse files
[ADD] - isosirface raytracer now provides zoom info to GBuffer in postprocessing mode.
parent
19ebfacf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
src/modules/isosurfaceRaytracer/shaders/WMIsosurfaceRaytracer-fragment.glsl
...faceRaytracer/shaders/WMIsosurfaceRaytracer-fragment.glsl
+4
-0
src/modules/isosurfaceRaytracer/shaders/WMIsosurfaceRaytracer-varyings.glsl
...faceRaytracer/shaders/WMIsosurfaceRaytracer-varyings.glsl
+3
-0
src/modules/isosurfaceRaytracer/shaders/WMIsosurfaceRaytracer-vertex.glsl
...urfaceRaytracer/shaders/WMIsosurfaceRaytracer-vertex.glsl
+6
-0
No files found.
src/modules/isosurfaceRaytracer/shaders/WMIsosurfaceRaytracer-fragment.glsl
View file @
204f5aac
...
...
@@ -143,6 +143,10 @@ void main()
wge_FragColor
=
vec4
(
1
.
0
,
0
.
0
,
0
.
0
,
1
.
0
);
gl_FragDepth
=
1
.
0
;
#ifdef WGE_POSTPROCESSING_ENABLED
wge_FragZoom
=
0
.
1
*
v_worldScale
;
#endif
// please do not laugh, it is a very very very simple "isosurface" shader
// First, find the rayEnd point. We need to do it in the fragment shader as the ray end point may be interpolated wrong
...
...
src/modules/isosurfaceRaytracer/shaders/WMIsosurfaceRaytracer-varyings.glsl
View file @
204f5aac
...
...
@@ -39,3 +39,6 @@ varying vec3 v_normal;
// The isovalue scaled using texture scaling information to [0,1]
varying
float
v_isovalue
;
// The scaling component of the modelview matrix.
varying
float
v_worldScale
;
src/modules/isosurfaceRaytracer/shaders/WMIsosurfaceRaytracer-vertex.glsl
View file @
204f5aac
...
...
@@ -81,6 +81,12 @@ void main()
vec4
camLookAt
=
vec4
(
0
.
0
,
0
.
0
,
-
1
.
0
,
0
.
0
);
v_ray
=
worldToLocal
(
camLookAt
).
xyz
;
#ifdef WGE_POSTPROCESSING_ENABLED
// Keep track of scaling information. This is needed by some postprocessors.
// TODO(ebaum): I do not yet understand this factor! Fix this.
v_worldScale
=
0
.
015
*
getModelViewScale
();
#endif
// Simply project the vertex
gl_Position
=
ftransform
();
gl_FrontColor
=
gl_Color
;
...
...
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