char volume_multipass_cube_frag[] = "#version 110\n" "\n" "uniform sampler2D colorTexture;\n" "uniform sampler2D depthTexture;\n" "uniform vec4 viewportDimensions;\n" "\n" "// declare function defined in volume_compute_ray_color.frag\n" "vec4 computeRayColor(vec4 fragColor, float px, float py, float depth_start, float depth_end);\n" "\n" "void main(void)\n" "{\n" " vec2 texcoord = vec2((gl_FragCoord.x-viewportDimensions[0])/viewportDimensions[2], (gl_FragCoord.y-viewportDimensions[1])/viewportDimensions[3]);\n" " vec4 color = texture2D( colorTexture, texcoord);\n" " float texture_depth = texture2D( depthTexture, texcoord).s;\n" " float front_depth = 0.0;\n" "\n" " if (gl_FragCoord.ztexture_depth) discard;\n" "\n" " // gl_FragDepth = texture_depth;\n" "\n" " // need to blend the object color with the ray from the object depth to the eye point\n" " vec4 ray_color = computeRayColor(vec4(0.0,0.0,0.0,0.0), gl_FragCoord.x, gl_FragCoord.y, texture_depth, front_depth);\n" " // ray_color *= vec4(1.0,1.0,0.0,1.0);\n" " gl_FragColor = mix(color, ray_color, ray_color.a);\n" " }\n" " }\n" "\n" "}\n" "\n";