[vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued

Richard Frank rickfrank at me.com
Mon Apr 4 11:48:08 EDT 2016


No I'm using 7.0.0 release not a git clone.

I guess I should get the latest? 

Rick


On Apr 04, 2016, at 10:53 AM, Aashish Chaudhary <aashish.chaudhary at kitware.com> wrote:

Thanks, and are you using VTK master as of last week since we had this problem and got fixed recently.  

- Aashish

On Mon, Apr 4, 2016 at 10:47 AM, Richard Frank <rickfrank at me.com> wrote:
Hi,

Here is a portion of code:


volumeProperty->SetColor(0, colorTransferFunction);
volumeProperty->SetColor(1, maskColorTransferFunction);
volumeProperty->SetScalarOpacity(opacityTransferFunction);
volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction);
volumeProperty->SetInterpolationTypeToLinear();
volumeProperty->ShadeOn();
volumeProperty->SetAmbient(0.4);
volumeProperty->SetDiffuse(0.8);
volumeProperty->SetSpecular(0.2);
volumeProperty->SetSpecularPower(105.0);
volumeProperty->SetScalarOpacityUnitDistance(0.7);
volume->SetProperty(volumeProperty);

The hard coded numbers are just picked empirically by viewing our most common inputs.

On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary <aashish.chaudhary at kitware.com> wrote:

Rick, 

Can you send me information on what you are turning on in volume property and in mapper that leads to this crash? Also, is your data is single or 2 or 4 component? 

Thanks,


On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank <rickfrank at me.com> wrote:
Further investigation seems to point the GradientOpacity section of shader  raycasterfs.glsl, code which seems to be inserted at runtime: I guess gl_aspect is not defined in this scenario?

Any suggestions welcome!

Rick

vec4 computeGradient() 
145: { 
146: vec3 g1; 
147: vec4 g2; 
148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; 
149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; 
150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; 
151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; 
152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; 
153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; 
154: g1 = g1*in_volume_scale.r + in_volume_bias.r; 
155: g2 = g2*in_volume_scale.r + in_volume_bias.r; 
156: g1.x = in_scalarsRange[0] + ( 
157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; 
158: g1.y = in_scalarsRange[0] + ( 
159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; 
160: g1.z = in_scalarsRange[0] + ( 
161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; 
162: g2.x = in_scalarsRange[0] + ( 
163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; 
164: g2.y = in_scalarsRange[0] + ( 
165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; 
166: g2.z = in_scalarsRange[0] + ( 
167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; 
168: g2.xyz = g1 - g2.xyz; 
169: g2.x /= g_aspect.x; 
170: g2.y /= g_aspect.y; 
171: g2.z /= g_aspect.z; 
172: float grad_mag = sqrt(g2.x * g2.x + 
173: g2.y * g2.y + 
174: g2.z * g2.z); 
175: if (grad_mag > 0.0) 
176: { 
177: g2.x /= grad_mag; 
178: g2.y /= grad_mag; 
179: g2.z /= grad_mag; 
180: } 
181: else 
182: { 
183: g2.xyz = vec3(0.0, 0.0, 0.0); 
184: } 
185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - 
186: (in_scalarsRange[0]))); 
187: grad_mag = clamp(grad_mag, 0.0, 1.0); 
188: g2.w = grad_mag; 
189: return g2; 
190: }




_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers




-- 
| Aashish Chaudhary 
| Technical Leader         
| Kitware Inc.            
| http://www.kitware.com/company/team/chaudhary.html



-- 
| Aashish Chaudhary 
| Technical Leader         
| Kitware Inc.            
| http://www.kitware.com/company/team/chaudhary.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160404/9329fe92/attachment.html>


More information about the vtkusers mailing list