[vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued

Richard Frank rickfrank at me.com
Sun Apr 3 21:25:55 EDT 2016


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: }



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160404/03a380dd/attachment.html>


More information about the vtkusers mailing list