Commit ddf9ac15 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - some additional renderoptions for imageSpaceLIC. Will be cleaned up later.

parent 601d5c5a
......@@ -101,7 +101,7 @@ vec3 project( vec3 point )
* This function transforms a point which is in world space, to a point in the local coordinate system of the object
* currently getting rendered.
* \note you can use this method with point.w == 0.0 for vector projection too.
*
*
* \param point the point in world coordinates
*
* \return the point in local coordinates
......
......@@ -82,6 +82,13 @@ void main()
float u_contrastingP = u_useHighContrast ? 8 : 2.5;
vec3 plainColor = u_cmapRatio * cmap + ( 1.0 - u_cmapRatio ) * vec3( u_contrastingS * pow( advected, u_contrastingP ) );
// MPI Paper Hack: {
/*plainColor = u_cmapRatio * cmap;
plainColor += 1.5*( 1.0 - u_cmapRatio ) * vec3( u_contrastingS * pow( advected, u_contrastingP ), 0.0, 0.0 );
if ( isZero( cmap.r, 0.1 ) )
discard;*/
// }
gl_FragColor = vec4(
( vec3( edge ) + plainColor ) // plain color mapped advection texture with edges
* clamp( 1.0 - ( float( u_useDepthCueing ) * depth * depth ), 0.4, 1.0 ) // scaled by depth if enabled
......
......@@ -84,6 +84,19 @@ void main()
float noise3D = 1.0;
#endif
// calculate lighting for the surface
// TODO(ebaum): material properties should be used instead
float light = blinnPhongIlluminationIntensity(
0.2,
1.0,
1.3,
10.0,
1.0,
0.3,
-normalize( v_normal ),
normalize( v_viewDir ),
normalize( v_lightSource ) );
#ifdef VECTORDATA
// get the current vector at this position
vec3 vec = texture3DUnscaled( u_texture0Sampler, gl_TexCoord[0].xyz, u_texture0Min, u_texture0Scale ).rgb;
......@@ -126,22 +139,32 @@ void main()
#endif
// calculate lighting for the surface
// TODO(ebaum): material properties should be used instead
float light = blinnPhongIlluminationIntensity(
0.2,
1.0,
1.3,
10.0,
1.0,
0.3,
-normalize( v_normal ),
normalize( v_viewDir ),
normalize( v_lightSource ) );
// MPI PAper Hack: {
/* vec4 cmap = colormapping();
gl_FragData[1] = vec4( vec3( cmap.r ), 1.0 );
if ( cmap.r < 0.15 )
discard;
if ( isZero( cmap.r - 0.2, 0.1 ) )
gl_FragData[1] = vec4( 0.25, 0.0, 0.0, 1.0 );
if ( isZero( cmap.r - 0.3, 0.1 ) )
gl_FragData[1] = vec4( 0.5, 0.0, 0.0, 1.0 );
if ( isZero( cmap.r - 1.0, 0.15 ) )
gl_FragData[1] = vec4( 1.0, 0.0, 0.0, 1.0 );
// }
*/
// is the vector very orthogonal to the surface?
vec2 dotScaled = ( 1.0 - dot( v_normal.xyz, vec.xyz ) ) * scaleMaxToOne( vecProjected ).xy;
float dotS = dot( v_normal, vec.xyz );
vec2 dotScaled = ( 1.0 + sign( dotS ) ) * scaleMaxToOne( vecProjected ).xy;
// MPI Paper Hack;
// dotScaled = 40.0*vecProjected.xy;
gl_FragData[0] = vec4( vec2( 0.5 ) + ( 0.5 * dotScaled ), light, noise3D );
// MPI PAper Hack:
// {
// //gl_FragData[1] = colormapping();
// }
gl_FragData[1] = colormapping();
}
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