Commit 7c3dc82c authored by Aashish Chaudhary's avatar Aashish Chaudhary

Fixed smart volume mapper level test

Change-Id: I0e6725b4522b3b82d6d0850082b350eef2c65aea
parent d296e253
......@@ -64,6 +64,8 @@ vec4 g_eyePosObj;
/// The first value is the size of the data array for clipping
/// planes (origin, normal)
uniform float in_clippingPlanes[49];
uniform float in_scale;
uniform float in_bias;
//////////////////////////////////////////////////////////////////////////////
///
......@@ -103,5 +105,8 @@ void main()
//VTK::Clipping::Exit
//VTK::Shading::Exit
g_fragColor.r = g_fragColor.r * in_scale + in_bias * g_fragColor.a;
g_fragColor.g = g_fragColor.g * in_scale + in_bias * g_fragColor.a;
g_fragColor.b = g_fragColor.b * in_scale + in_bias * g_fragColor.a;
gl_FragColor = g_fragColor;
}
......@@ -2346,6 +2346,12 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
// Updating clipping if enabled
this->Impl->UpdateClipping(ren, vol);
// Finally set the scale and bias for color correction
this->Impl->ShaderProgram->SetUniformf("in_scale",
1.0 / this->FinalColorWindow);
this->Impl->ShaderProgram->SetUniformf("in_bias",
(0.5 - (this->FinalColorLevel/this->FinalColorWindow)));
#ifndef __APPLE__
glBindVertexArray(this->Impl->CubeVAOId);
#endif
......
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