<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">On researching my previous question about how the volume rendering is made lower resolution during rotation,<div>I did some tracing of the code, and found what I believe is a problem related to a Macro.</div><div><div><br></div><div>This is the section of code that determines whether the sampling distance is computed on the fly for the GPURenderMode:</div><div><br></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9.5pt; font-family: Consolas; color: blue; ">case</span><span style="font-size: 9.5pt; font-family: Consolas; "> vtkSmartVolumeMapper::GPURenderMode:<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9.5pt; font-family: Consolas; "> ...</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9.5pt; font-family: Consolas; "> usedMapper->SetAutoAdjustSampleDistances(<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9.5pt; font-family: Consolas; "> ren->GetRenderWindow()->GetDesiredUpdateRate()>=<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9.5pt; font-family: Consolas; "> <span style="color: blue; ">this</span>->InteractiveUpdateRate);<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9.5pt; font-family: Consolas; "> usedMapper->Render(ren, vol);<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9.5pt; font-family: Consolas; "> <span style="color: blue; ">break</span>;<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p><br></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p>Here it seems that SetAutoAdjustSampleDistance(int) if passed 0 will turn off auto adjusting sampling distance.</o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p><br></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p>If I look at </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p><br></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p><span style="font-family: Consolas; font-size: 13px; ">ren->GetRenderWindow()->GetDesiredUpdateRate() it is equal to 0.0001;</span></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p><span style="font-family: Consolas; font-size: 13px; "><br></span></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p><span style="font-family: Consolas; font-size: 13px; color: blue; ">this</span><span style="font-family: Consolas; font-size: 13px; ">->InteractiveUpdateRate == 1.0;</span></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p><span style="font-family: Consolas; font-size: 13px; "><br></span></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p><span style="font-family: Consolas; font-size: 13px; ">so, </span></o:p><span style="font-family: Consolas; font-size: 13px; ">GetDesiredUpdateRate is not greater than or equal to </span><span style="font-family: Consolas; font-size: 13px; ">InteractiveUpdateRate,</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: Consolas; font-size: 13px; ">and so </span><span style="font-family: Consolas; font-size: 13px; ">SetAutoAdjustSampleDistances() should be passed 0 (or false) and turned off.</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: Consolas; font-size: 13px; ">But it's not.</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-family: Consolas; font-size: 13px; ">SetAutoAdjustSampleDistance is defined as some macros</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; color: green; ">/ Description:</span><span style="font-size: 9.5pt; font-family: Consolas; "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "> <span style="color: green; ">// If AutoAdjustSampleDistances is on, the the ImageSampleDistance</span><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "> <span style="color: green; ">// will be varied to achieve the allocated render time of this</span><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "> <span style="color: green; ">// prop (controlled by the desired update rate and any culling in</span><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "> <span style="color: green; ">// use).</span><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "> vtkSetClampMacro( AutoAdjustSampleDistances, <span style="color: blue; ">int</span>, 0, 1 );<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "> vtkGetMacro( AutoAdjustSampleDistances, <span style="color: blue; ">int</span> );<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "> vtkBooleanMacro( AutoAdjustSampleDistances, <span style="color: blue; ">int</span> );</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; ">if I change the code to </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; ">int val = </span><span style="font-family: Consolas; font-size: 9.5pt; ">ren->GetRenderWindow()->GetDesiredUpdateRate()>=</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "> <span style="color: blue; ">this</span>->InteractiveUpdateRate; </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-size: 9.5pt; font-family: Consolas; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-family: Consolas; font-size: 13px; ">usedMapper->SetAutoAdjustSampleDistances(val);</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-family: Consolas; font-size: 13px; ">val is 0 and still doesn't turn it off.</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-family: Consolas; font-size: 13px; ">HOWEVER if I change the code to </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; "><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; ">usedMapper->SetAutoAdjustSampleDistances(0); </span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; ">IT WORKS - the Auto Adjustment is off and I get smooth rotations.</span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; ">Seems odd to me, and perhaps a bug with the macro definition?</span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; ">I'm using Windows Visual Studio 7, but we also see this on Ubuntu Linux with gcc </span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; ">Can someone verify?</span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; ">Thanks</span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; ">Rick</span></div><div style="font-size: 11pt; margin: 0in 0in 0.0001pt; "><span style="font-family: Consolas; font-size: 13px; "><br></span></div><div><span style="font-family: Consolas; font-size: 13px; "><br></span></div></div></div></div></body></html>