Commit 204f5aac authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - isosirface raytracer now provides zoom info to GBuffer in postprocessing mode.

parent 19ebfacf
......@@ -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
......
......@@ -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;
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment