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