Commit 6fca3750 authored by Aashish Chaudhary's avatar Aashish Chaudhary

Fixed bad first sample along the ray and added notes

This branch fixes various issues with texture coordinate computations
for various corner cases. Specifically, for the one where the we
have point dataset and a offset is applied to each texture coordinate
so that it samples at the center of the texel.
parent e4ff7f81
......@@ -106,8 +106,6 @@ void main()
{
//VTK::Base::Impl
//VTK::Terminate::Impl
//VTK::Cropping::Impl
//VTK::Clipping::Impl
......@@ -122,6 +120,8 @@ void main()
/// Advance ray
g_dataPos += g_dirStep;
//VTK::Terminate::Impl
}
//VTK::Base::Exit
......
......@@ -1277,7 +1277,7 @@ namespace vtkvolume
\n {\
\n vec3 delta = in_textureExtentsMax - in_textureExtentsMin;\
\n l_tex_min = vec3(0.5) / delta;\
\n l_tex_max = (1.0 * (delta - vec3(1.0)) + vec3(0.5)) / delta;\
\n l_tex_max = (delta - vec3(0.5)) / delta;\
\n }\
\n\
\n // Flag to indicate if the raymarch loop should terminate \
......@@ -1344,6 +1344,10 @@ namespace vtkvolume
vtkVolume* vtkNotUsed(vol))
{
return std::string("\
\n // sign function performs component wise operation and returns -1\
\n // if the difference is less than 0, 0 if equal to 0, and 1 if\
\n // above 0. So if the ray is inside the volume, dot product will\
\n // always be 3.\
\n stop = dot(sign(g_dataPos - l_tex_min), sign(l_tex_max - g_dataPos))\
\n < 3.0;\
\n\
......
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