Commit 9726a9ec authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - modified projection of ray into texture space

parent 3ee738af
......@@ -80,6 +80,10 @@ void main()
discard;
}
gl_FragColor = vec4( vec3( 1.0 - i/750.0 ), 1.0 );//texture3D( tex0, curPoint );
gl_FragColor = vec4( vec3( 1.0 - i/1000.0 ), 1.0 );//texture3D( tex0, curPoint );
//gl_FragColor = vec4( v_rayStart, 1.0 );
// gl_FragColor = vec4( abs(v_normal), 1.0 );
// gl_FragColor = vec4( v_ray, 1.0 );
}
......@@ -33,3 +33,5 @@ varying vec3 v_rayStart;
// The ray direction in texture space
varying vec3 v_ray;
// the Surface normal at this point
varying vec3 v_normal;
......@@ -56,12 +56,13 @@ void main()
{
// for easy access to texture coordinates
gl_TexCoord[0] = gl_MultiTexCoord0;
v_normal = gl_Normal;
// in texture space, the starting point simply is the current surface point in texture space
v_rayStart = gl_TexCoord[0].xyz;
// transform the ray direction to texture space
v_ray = normalize( gl_ModelViewMatrixInverse * -gl_TexCoord[0] ).xyz;
v_ray = -normalize( gl_ModelViewMatrixInverse * vec4( 0.0, 1.0, 0.0, 1.0 ) ).xyz;
// Simply project the vertex
gl_Position = ftransform();
......
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