diff --git a/application/glsl/datacontainerinspector.frag b/application/glsl/datacontainerinspector.frag index 7ee4cb7d216a7691d9e38e7af2181cb79b6b2578..21c378d574e0015a116fc0e2c40650b07e0a8520 100644 --- a/application/glsl/datacontainerinspector.frag +++ b/application/glsl/datacontainerinspector.frag @@ -60,17 +60,17 @@ void main() { // perform MIP out_Color = vec4(0.0); for (float slice = 0.0; slice < 1.0; slice += _3dTextureParams._sizeRCP.z) { - out_Color = max(out_Color, lookupTF(_transferFunction, _transferFunctionParams, getElement3DNormalized(_texture3d, _3dTextureParams, vec3(ex_TexCoord.xy, slice)).r)); + out_Color = max(out_Color, lookupTF(_transferFunction, _transferFunctionParams, texture(_texture3d, vec3(ex_TexCoord.xy, slice)).r)); } } else { // render the corresponding slice vec3 coord = vec3(ex_TexCoord.xy, (_sliceNumber + 0.5) / (_3dTextureParams._size.z)); - out_Color = lookupTF(_transferFunction, _transferFunctionParams, getElement3DNormalized(_texture3d, _3dTextureParams, coord).r); + out_Color = lookupTF(_transferFunction, _transferFunctionParams, texture(_texture3d, coord).r); } } else { - vec4 texel = getElement2DNormalized(_texture2d, _2dTextureParams, ex_TexCoord.xy); + vec4 texel = texture(_texture2d, ex_TexCoord.xy); if (_2dTextureParams._numChannels == 1) { out_Color = lookupTF(_transferFunction, _transferFunctionParams, texel.r); } diff --git a/core/glsl/copyimage.frag b/core/glsl/copyimage.frag index 60af56234f7d65f3e05f6c16812900b4946a9756..27371423cd44cf21225fa0e67202c18137a9a31a 100644 --- a/core/glsl/copyimage.frag +++ b/core/glsl/copyimage.frag @@ -42,9 +42,9 @@ uniform sampler2D _depthTexture; void main() { vec2 fragCoord = gl_FragCoord.xy * _viewportSizeRCP; - out_Color = getElement2DNormalized(_colorTexture, _texParams, fragCoord); + out_Color = texture(_colorTexture, fragCoord); #ifndef NO_DEPTH - gl_FragDepth = getElement2DNormalized(_depthTexture, _texParams, fragCoord).r; + gl_FragDepth = texture(_depthTexture, fragCoord).r; #endif } diff --git a/core/glsl/tools/gradient.frag b/core/glsl/tools/gradient.frag index d19bdc2426670bdbb497c3ee24036c3491a2885a..824b4a7b2852cae7fecff1f338a58b744c7cdf80 100644 --- a/core/glsl/tools/gradient.frag +++ b/core/glsl/tools/gradient.frag @@ -182,4 +182,4 @@ vec3 computeGradientSobel(in sampler3D tex, in vec3 texCoords) { sobel.z += value; return -sobelScale * sobel; -} \ No newline at end of file +} diff --git a/core/glsl/tools/masking.frag b/core/glsl/tools/masking.frag index 84991026dfeda00481530ad14a6ea7ffbd61bf76..9ff47cb9cf1a5a4d19795eb126514dc1f3e3b1b5 100644 --- a/core/glsl/tools/masking.frag +++ b/core/glsl/tools/masking.frag @@ -35,7 +35,7 @@ uniform TextureParameters2D _maskTexParams; uniform vec4 _maskColor; ///< mask color #define MASKING_PROLOG(COORDS) \ - vec4 maskValue = getElement2DNormalized(_maskImage, _maskTexParams, (COORDS) ); \ + vec4 maskValue = texture(_maskImage, (COORDS) ); \ if (distance(maskValue, _maskColor) > 0.01) { #define MASKING_EPILOG \ diff --git a/core/glsl/tools/texture2d.frag b/core/glsl/tools/texture2d.frag index a26e77b414fdfcbdbfbd074e5c696eff98edb5ff..ab7039658d8e1302875ab28a192cb42121e1f000 100644 --- a/core/glsl/tools/texture2d.frag +++ b/core/glsl/tools/texture2d.frag @@ -34,28 +34,3 @@ struct TextureParameters2D { vec2 _sizeRCP; int _numChannels; }; - -/** - * Texture lookup function for 2D textures using pixel coordinates, i.e [(0,0) , textureSize]. - * \param tex Sampler to texture - * \param texParams TextureParameters2D struct with texture for lookup - * \param texCoords Lookup coordinates in pixel coordinates - * \return The texel at the given coordinates. - */ -vec4 getElement2D(in sampler2D tex, in TextureParameters2D texParams, in vec2 texCoords) { - vec2 texCoordsNormalized = texCoords * texParams._sizeRCP; - //vec2 texCoordsTransformed = (texParams.matrix_ * vec4(texCoordsNormalized, 0.0, 1.0)).xy; - return texture(tex, texCoordsNormalized); -} - -/** - * Texture lookup function for 2D textures using normalized texture coordinates, i.e. [0,1]. - * \param tex Sampler to texture - * \param texParams TextureParameters2D struct with texture for lookup - * \param texCoords Lookup coordinates in normlized texture coordinates - * \return The texel at the given coordinates. - */ -vec4 getElement2DNormalized(in sampler2D tex, in TextureParameters2D texParams, in vec2 texCoords) { - //vec2 texCoordsTransformed = (texParams.matrix_ * vec4(texCoords, 0.0, 1.0)).xy; - return texture(tex, texCoords); -} diff --git a/core/glsl/tools/texture3d.frag b/core/glsl/tools/texture3d.frag index 60736fe355990c1205c4eec5070121bb00d98b2a..9ef22374dd45ad304eb563c8f62cc5421ad6cf76 100644 --- a/core/glsl/tools/texture3d.frag +++ b/core/glsl/tools/texture3d.frag @@ -48,31 +48,6 @@ struct TextureParameters3D { vec2 _realWorldMapping; }; -/** - * Texture lookup function for 3D textures using voxel coordinates, i.e [(0,0) , textureSize]. - * \param tex Sampler to texture - * \param texParams TextureParameters3D struct with texture for lookup - * \param texCoords Lookup coordinates in pixel coordinates - * \return The texel at the given coordinates. - */ -vec4 getElement3D(in sampler3D tex, in TextureParameters3D texParams, in vec3 texCoords) { - vec3 texCoordsNormalized = texCoords * texParams._sizeRCP; - //vec2 texCoordsTransformed = (texParams.matrix_ * vec4(texCoordsNormalized, 0.0, 1.0)).xy; - return texture(tex, texCoordsNormalized); -} - -/** - * Texture lookup function for 3D textures using normalized texture coordinates, i.e. [0,1]. - * \param tex Sampler to texture - * \param texParams TextureParameters3D struct with texture for lookup - * \param texCoords Lookup coordinates in normlized texture coordinates - * \return The texel at the given coordinates. - */ -vec4 getElement3DNormalized(in sampler3D tex, in TextureParameters3D texParams, in vec3 texCoords) { - //vec2 texCoordsTransformed = (texParams.matrix_ * vec4(texCoords, 0.0, 1.0)).xy; - return texture(tex, texCoords); -} - /** * Transforms texture coordinates for texture \a tex to world coordinates using the texture's * texture-to-world matrix. diff --git a/modules/advancedusvis/glsl/advancedusfusion.frag b/modules/advancedusvis/glsl/advancedusfusion.frag index 9eedc2fb37f18c57093388053f697fbf7552e8f0..67f947900a60bed6d6e8f96d007cfedea4c938f7 100644 --- a/modules/advancedusvis/glsl/advancedusfusion.frag +++ b/modules/advancedusvis/glsl/advancedusfusion.frag @@ -38,11 +38,11 @@ out vec4 out_Color; #ifdef USE_3D_TEX #define SAMPLER_TYPE sampler3D #define TEXPARAMS_TYPE TextureParameters3D -#define TEXTURE_LOOKUP_FUNC getElement3DNormalized +#define TEXTURE_LOOKUP_FUNC texture #else #define SAMPLER_TYPE sampler2D #define TEXPARAMS_TYPE TextureParameters2D -#define TEXTURE_LOOKUP_FUNC getElement2DNormalized +#define TEXTURE_LOOKUP_FUNC texture #endif uniform SAMPLER_TYPE _usImage; @@ -73,9 +73,9 @@ void main() { vec2 texCoord = ex_TexCoord.xy; #endif - vec4 texel = TEXTURE_LOOKUP_FUNC(_usImage, _usTextureParams, texCoord); - vec4 blurred = TEXTURE_LOOKUP_FUNC(_blurredImage, _blurredTextureParams, texCoord) * _blurredScale; - float confidence = clamp(TEXTURE_LOOKUP_FUNC(_confidenceMap, _confidenceTextureParams, texCoord).r * _confidenceScaling, 0.0, 1.0); + vec4 texel = TEXTURE_LOOKUP_FUNC(_usImage, texCoord); + vec4 blurred = TEXTURE_LOOKUP_FUNC(_blurredImage, texCoord) * _blurredScale; + float confidence = clamp(TEXTURE_LOOKUP_FUNC(_confidenceMap, texCoord).r * _confidenceScaling, 0.0, 1.0); float uncertainty = lookupTF(_confidenceTF, _confidenceTFParams, confidence).a; if (confidence <= 0.0) { diff --git a/modules/columbia/glsl/geometrystrainrenderer.frag b/modules/columbia/glsl/geometrystrainrenderer.frag index 9cc21bf3e5c57cc097c1eda81de7d5a5c5cf0515..3d74c5021e6a750a608943d2d547c092465b1936 100644 --- a/modules/columbia/glsl/geometrystrainrenderer.frag +++ b/modules/columbia/glsl/geometrystrainrenderer.frag @@ -47,12 +47,12 @@ void main() { vec3 worldCoords = ex_Position.xyz / ex_Position.z; vec3 texCoords = worldToTexture(_textureParameters, worldCoords); - out_Color = getElement3DNormalized(_strainTexture, _textureParameters, texCoords); + out_Color = texture(_strainTexture, texCoords); while (length(out_Color) == 0.0) { worldCoords -= normalize(ex_TexCoord) * 0.1; texCoords = worldToTexture(_textureParameters, worldCoords); - out_Color = getElement3DNormalized(_strainTexture, _textureParameters, texCoords); + out_Color = texture(_strainTexture, texCoords); } #ifdef ENABLE_SHADING diff --git a/modules/columbia/glsl/strainraycaster.frag b/modules/columbia/glsl/strainraycaster.frag index b78e76929f684349040c81285dd446aff38c1870..1c11b78eaf22c579ec0e4ddd413e7014a83b1d26 100644 --- a/modules/columbia/glsl/strainraycaster.frag +++ b/modules/columbia/glsl/strainraycaster.frag @@ -94,7 +94,7 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) vec3 samplePosition = entryPoint.rgb + t * direction; // lookup intensity and TF - vec4 strain = getElement3DNormalized(_volume, _volumeTextureParams, samplePosition); + vec4 strain = texture(_volume, samplePosition); vec4 color = (_volumeTextureParams._numChannels == 4) ? strain : vec4(strain.xyz, 0.0); color.a = clamp(length(strain.xyz)/1.0, 0.0, 1.0); @@ -114,7 +114,7 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) vec3 newSamplePosition = entryPoint.rgb + newT * direction; // lookup refined intensity + TF - vec4 newStrain = getElement3DNormalized(_volume, _volumeTextureParams, newSamplePosition); + vec4 newStrain = texture(_volume, newSamplePosition); vec4 newColor = (_volumeTextureParams._numChannels == 4) ? newStrain : vec4(newStrain.xyz, 0.0); newColor.a = clamp(length(newColor.xyz)/1.0, 0.0, 1.0); @@ -168,8 +168,8 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) // calculate depth value from ray parameter gl_FragDepth = 1.0; if (firstHitT >= 0.0) { - float depthEntry = getElement2DNormalized(_entryPointsDepth, _entryParams, texCoords).z; - float depthExit = getElement2DNormalized(_exitPointsDepth, _exitParams, texCoords).z; + float depthEntry = texture(_entryPointsDepth, texCoords).z; + float depthExit = texture(_exitPointsDepth, texCoords).z; gl_FragDepth = calculateDepthValue(firstHitT/tend, depthEntry, depthExit); } return result; @@ -180,8 +180,8 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) ***/ void main() { vec2 p = gl_FragCoord.xy * _viewportSizeRCP; - vec3 frontPos = getElement2DNormalized(_entryPoints, _entryParams, p).rgb; - vec3 backPos = getElement2DNormalized(_exitPoints, _exitParams, p).rgb; + vec3 frontPos = texture(_entryPoints, p).rgb; + vec3 backPos = texture(_exitPoints, p).rgb; //determine whether the ray has to be casted if (frontPos == backPos) { diff --git a/modules/ixpv/glsl/ixpvcompositor.frag b/modules/ixpv/glsl/ixpvcompositor.frag index ba6e9990d9a5ca79ce879ac6c62a1d9275bf0259..4b2e6353aea44806d6c6e372d61b1d677c17a850 100644 --- a/modules/ixpv/glsl/ixpvcompositor.frag +++ b/modules/ixpv/glsl/ixpvcompositor.frag @@ -52,13 +52,13 @@ uniform TextureParameters2D _drrClippedTexParams; ***/ void main() { // fetch input textures - vec4 xRayColor = getElement2DNormalized(_xRayColor, _xRayTexParams, ex_TexCoord.xy); - float xRayDepth = getElement2DNormalized(_xRayDepth, _xRayTexParams, ex_TexCoord.xy).r; - vec4 sliceColor = getElement2DNormalized(_sliceColor, _sliceTexParams, ex_TexCoord.xy); - float sliceDepth = getElement2DNormalized(_sliceDepth, _sliceTexParams, ex_TexCoord.xy).r; + vec4 xRayColor = texture(_xRayColor, ex_TexCoord.xy); + float xRayDepth = texture(_xRayDepth, ex_TexCoord.xy).r; + vec4 sliceColor = texture(_sliceColor, ex_TexCoord.xy); + float sliceDepth = texture(_sliceDepth, ex_TexCoord.xy).r; - float drrFull = getElement2DNormalized(_drrFullColor, _drrFullTexParams, ex_TexCoord.xy).r; - float drrClipped = getElement2DNormalized(_drrClippedColor, _drrClippedTexParams, ex_TexCoord.xy).r; + float drrFull = texture(_drrFullColor, ex_TexCoord.xy).r; + float drrClipped = texture(_drrClippedColor, ex_TexCoord.xy).r; float weightingFactor = 0.0; if (drrClipped > 0) diff --git a/modules/scr_msk/glsl/trackedussweepframerenderer3d.frag b/modules/scr_msk/glsl/trackedussweepframerenderer3d.frag index 76b95ba24d9e71b88393028e2f1acfee844cc788..039c194c7cc0548367b07a5537ad2b6a0735e4c0 100644 --- a/modules/scr_msk/glsl/trackedussweepframerenderer3d.frag +++ b/modules/scr_msk/glsl/trackedussweepframerenderer3d.frag @@ -44,7 +44,7 @@ void main() { out_Color = vec4(1.0); } else { - float intensity = getElement2DNormalized(_texture, _textureParameters, ex_TexCoord.xy).a; + float intensity = texture(_texture, ex_TexCoord.xy).a; out_Color = lookupTF(_transferFunction, _transferFunctionParams, intensity); // don't write fragment if fully transparent (in particular don't write to depth buffer!) diff --git a/modules/vis/glsl/depthdarkening.frag b/modules/vis/glsl/depthdarkening.frag index dd218b6a93265dcdd9093da3d11671d0fc3ae0e2..3402965abb29d825510f12a147a97a7666a57f93 100644 --- a/modules/vis/glsl/depthdarkening.frag +++ b/modules/vis/glsl/depthdarkening.frag @@ -89,7 +89,7 @@ float applyDepthGaussFilter(in vec2 texCoord) { for (int i = -_halfKernelDimension; i <= _halfKernelDimension; ++i) { // TODO: why the fuck does abs(i) not work here?!? int absi = (i < 0) ? -i : i; - float curDepth = getElement2DNormalized(_depthPass2Texture, _pass2TexParams, texCoord + (_direction * _viewportSizeRCP * i)).r; + float curDepth = texture(_depthPass2Texture, texCoord + (_direction * _viewportSizeRCP * i)).r; result += curDepth * _gaussKernel[absi]; } result /= _norm; @@ -110,11 +110,11 @@ void main() { gl_FragDepth = filteredDepth; } else { // we are in the second vertical pass and have to modulate the color - float curDepth = getElement2DNormalized(_depthTexture, _texParams, texCoord).r; + float curDepth = texture(_depthTexture, texCoord).r; float deltaD = normalizeDepth(filteredDepth) - normalizeDepth(curDepth); // apply depth darkening - vec4 curColor = getElement2DNormalized(_colorTexture, _texParams, texCoord); + vec4 curColor = texture(_colorTexture, texCoord); if (curColor.a == 0) discard; diff --git a/modules/vis/glsl/drrraycaster.frag b/modules/vis/glsl/drrraycaster.frag index d91d10085678e76f1749e2c04d9bb1df9d5ebd67..aba129acda2d01f5fd6a80360c37c91f50b023ff 100644 --- a/modules/vis/glsl/drrraycaster.frag +++ b/modules/vis/glsl/drrraycaster.frag @@ -79,7 +79,7 @@ vec4 raycastDRR(in vec3 entryPoint, in vec3 exitPoint) { vec3 samplePosition = entryPoint.rgb + t * direction; // lookup intensity and TF - float intensity = getElement3DNormalized(_volume, _volumeTextureParams, samplePosition).r; + float intensity = texture(_volume, samplePosition).r; vec4 color = lookupTF(_transferFunction, _transferFunctionParams, intensity); #ifdef DEPTH_MAPPING @@ -130,8 +130,8 @@ vec4 raycastDRR(in vec3 entryPoint, in vec3 exitPoint) { ***/ void main() { vec2 p = gl_FragCoord.xy * _viewportSizeRCP; - vec3 frontPos = getElement2DNormalized(_entryPoints, _entryParams, p).rgb; - vec3 backPos = getElement2DNormalized(_exitPoints, _exitParams, p).rgb; + vec3 frontPos = texture(_entryPoints, p).rgb; + vec3 backPos = texture(_exitPoints, p).rgb; //determine whether the ray has to be casted if (frontPos == backPos) { diff --git a/modules/vis/glsl/eepgenerator.frag b/modules/vis/glsl/eepgenerator.frag index 93f85adc7266af65399712e2eb30281b989f46be..dc73ce043d05505d23c1affa90f191dc46002574 100644 --- a/modules/vis/glsl/eepgenerator.frag +++ b/modules/vis/glsl/eepgenerator.frag @@ -57,7 +57,7 @@ void main() { float fragDepth = gl_FragCoord.z; if (_integrateGeometry) { - float geometryDepth = getElement2DNormalized(_geometryDepthTexture, _geometryDepthTexParams, fragCoordNormalized).r; + float geometryDepth = texture(_geometryDepthTexture, fragCoordNormalized).r; if (_isEntrypoint) { // integrating geometry into Entrypoints @@ -76,7 +76,7 @@ void main() { } else { // integrating geometry into Exitpoints - float entryDepth = getElement2DNormalized(_entryDepthTexture, _entryDepthTexParams, fragCoordNormalized).r; + float entryDepth = texture(_entryDepthTexture, fragCoordNormalized).r; float exitDepth = gl_FragCoord.z; if (geometryDepth <= entryDepth) { diff --git a/modules/vis/glsl/optimizedraycaster.frag b/modules/vis/glsl/optimizedraycaster.frag index 491ee55dca8dfec0234e24e990b1be660688ad40..36fbabe91cf64fce8faf9036b7d28490c0fb686d 100644 --- a/modules/vis/glsl/optimizedraycaster.frag +++ b/modules/vis/glsl/optimizedraycaster.frag @@ -153,7 +153,7 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) } // lookup intensity and TF - float intensity = getElement3DNormalized(_volume, _volumeTextureParams, samplePosition).r; + float intensity = texture(_volume, samplePosition).r; vec4 color = lookupTF(_transferFunction, _transferFunctionParams, intensity); #ifdef INTERSECTION_REFINEMENT @@ -172,7 +172,7 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) vec3 newSamplePosition = entryPoint.rgb + newT * direction; // lookup refined intensity + TF - float newIntensity = getElement3DNormalized(_volume, _volumeTextureParams, newSamplePosition).r; + float newIntensity = texture(_volume, newSamplePosition).r; vec4 newColor = lookupTF(_transferFunction, _transferFunctionParams, newIntensity); if (newColor.a <= 0.0) { @@ -225,8 +225,8 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) // calculate depth value from ray parameter gl_FragDepth = 1.0; if (firstHitT >= 0.0) { - float depthEntry = getElement2DNormalized(_entryPointsDepth, _entryParams, texCoords).z; - float depthExit = getElement2DNormalized(_exitPointsDepth, _exitParams, texCoords).z; + float depthEntry = texture(_entryPointsDepth, texCoords).z; + float depthExit = texture(_exitPointsDepth, texCoords).z; gl_FragDepth = calculateDepthValue(firstHitT/tend, depthEntry, depthExit); } @@ -238,8 +238,8 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) ***/ void main() { vec2 p = gl_FragCoord.xy * _viewportSizeRCP; - vec3 frontPos = getElement2DNormalized(_entryPoints, _entryParams, p).rgb; - vec3 backPos = getElement2DNormalized(_exitPoints, _exitParams, p).rgb; + vec3 frontPos = texture(_entryPoints, p).rgb; + vec3 backPos = texture(_exitPoints, p).rgb; //determine whether the ray has to be casted if (frontPos == backPos) { diff --git a/modules/vis/glsl/quadview.frag b/modules/vis/glsl/quadview.frag index 2246b8dcb9a67a9471a458efbb77cc40bd83f439..3e32f1908c942fdef3d94a6bf68df9b59524efa1 100644 --- a/modules/vis/glsl/quadview.frag +++ b/modules/vis/glsl/quadview.frag @@ -37,6 +37,6 @@ uniform sampler2D _depthTexture; uniform TextureParameters2D _texParams; void main() { - out_Color = getElement2DNormalized(_colorTexture, _texParams, ex_TexCoord.xy); - gl_FragDepth = getElement2DNormalized(_depthTexture, _texParams, ex_TexCoord.xy).r; + out_Color = texture(_colorTexture, ex_TexCoord.xy); + gl_FragDepth = texture(_depthTexture, ex_TexCoord.xy).r; } diff --git a/modules/vis/glsl/rendertargetcompositor.frag b/modules/vis/glsl/rendertargetcompositor.frag index 70ffcb9854f26bf0dae9bfe70c902658180dd534..f99d00b7c3a0c1001306fd5317b00249c495b49b 100644 --- a/modules/vis/glsl/rendertargetcompositor.frag +++ b/modules/vis/glsl/rendertargetcompositor.frag @@ -47,45 +47,45 @@ uniform float _alpha; void main() { if (_compositingMethod == 0) { // only first - out_Color = getElement2DNormalized(_firstColor, _firstTexParams, ex_TexCoord.xy); - gl_FragDepth = getElement2DNormalized(_firstDepth, _firstTexParams, ex_TexCoord.xy).r; + out_Color = texture(_firstColor, ex_TexCoord.xy); + gl_FragDepth = texture(_firstDepth, ex_TexCoord.xy).r; } else if (_compositingMethod == 1) { // only second - out_Color = getElement2DNormalized(_secondColor, _secondTexParams, ex_TexCoord.xy); - gl_FragDepth = getElement2DNormalized(_secondDepth, _secondTexParams, ex_TexCoord.xy).r; + out_Color = texture(_secondColor, ex_TexCoord.xy); + gl_FragDepth = texture(_secondDepth, ex_TexCoord.xy).r; } else if (_compositingMethod == 2) { // alpha blending - vec4 firstColor = getElement2DNormalized(_firstColor, _firstTexParams, ex_TexCoord.xy); - float firstDepth = getElement2DNormalized(_firstDepth, _firstTexParams, ex_TexCoord.xy).r; - vec4 secondColor = getElement2DNormalized(_secondColor, _secondTexParams, ex_TexCoord.xy); - float secondDepth = getElement2DNormalized(_secondDepth, _secondTexParams, ex_TexCoord.xy).r; + vec4 firstColor = texture(_firstColor, ex_TexCoord.xy); + float firstDepth = texture(_firstDepth, ex_TexCoord.xy).r; + vec4 secondColor = texture(_secondColor, ex_TexCoord.xy); + float secondDepth = texture(_secondDepth, ex_TexCoord.xy).r; out_Color = mix(firstColor, secondColor, _alpha); gl_FragDepth = min(firstDepth, secondDepth); } else if (_compositingMethod == 3) { // difference - vec4 firstColor = getElement2DNormalized(_firstColor, _firstTexParams, ex_TexCoord.xy); - float firstDepth = getElement2DNormalized(_firstDepth, _firstTexParams, ex_TexCoord.xy).r; - vec4 secondColor = getElement2DNormalized(_secondColor, _secondTexParams, ex_TexCoord.xy); - float secondDepth = getElement2DNormalized(_secondDepth, _secondTexParams, ex_TexCoord.xy).r; + vec4 firstColor = texture(_firstColor, ex_TexCoord.xy); + float firstDepth = texture(_firstDepth, ex_TexCoord.xy).r; + vec4 secondColor = texture(_secondColor, ex_TexCoord.xy); + float secondDepth = texture(_secondDepth, ex_TexCoord.xy).r; out_Color = vec4(vec3(1.0) - abs(firstColor - secondColor).xyz, max(firstColor.w, secondColor.w)); gl_FragDepth = min(firstDepth, secondDepth); } else if (_compositingMethod == 4) { // depth test - float firstDepth = getElement2DNormalized(_firstDepth, _firstTexParams, ex_TexCoord.xy).r; - float secondDepth = getElement2DNormalized(_secondDepth, _secondTexParams, ex_TexCoord.xy).r; + float firstDepth = texture(_firstDepth, ex_TexCoord.xy).r; + float secondDepth = texture(_secondDepth, ex_TexCoord.xy).r; if (firstDepth > secondDepth) { - out_Color = getElement2DNormalized(_secondColor, _secondTexParams, ex_TexCoord.xy); + out_Color = texture(_secondColor, ex_TexCoord.xy); gl_FragDepth = secondDepth; } else { - out_Color = getElement2DNormalized(_firstColor, _firstTexParams, ex_TexCoord.xy); + out_Color = texture(_firstColor, ex_TexCoord.xy); gl_FragDepth = firstDepth; } } diff --git a/modules/vis/glsl/simpleraycaster.frag b/modules/vis/glsl/simpleraycaster.frag index 0da7d49b46f47c2b158b2ecdc9e694119baacd2c..b9176667b3e5ccf037f9f005546a7b25cae2a44a 100644 --- a/modules/vis/glsl/simpleraycaster.frag +++ b/modules/vis/glsl/simpleraycaster.frag @@ -93,7 +93,7 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) vec3 samplePosition = entryPoint.rgb + t * direction; // lookup intensity and TF - float intensity = getElement3DNormalized(_volume, _volumeTextureParams, samplePosition).r; + float intensity = texture(_volume, samplePosition).r; vec4 color = lookupTF(_transferFunction, _transferFunctionParams, intensity); #ifdef ENABLE_SHADOWING @@ -109,7 +109,7 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) // traverse ray from sample to light while (! finished) { // grab intensity and TF opacity - intensity = getElement3DNormalized(_volume, _volumeTextureParams, position).r; + intensity = texture(_volume, position).r; shadowFactor += lookupTF(_transferFunction, _transferFunctionParams, intensity).a; position += L; @@ -156,8 +156,8 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) // calculate depth value from ray parameter gl_FragDepth = 1.0; if (firstHitT >= 0.0) { - float depthEntry = getElement2DNormalized(_entryPointsDepth, _entryParams, texCoords).z; - float depthExit = getElement2DNormalized(_exitPointsDepth, _exitParams, texCoords).z; + float depthEntry = texture(_entryPointsDepth, texCoords).z; + float depthExit = texture(_exitPointsDepth, texCoords).z; gl_FragDepth = calculateDepthValue(firstHitT/tend, depthEntry, depthExit); } return result; @@ -168,8 +168,8 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords) ***/ void main() { vec2 p = gl_FragCoord.xy * _viewportSizeRCP; - vec3 frontPos = getElement2DNormalized(_entryPoints, _entryParams, p).rgb; - vec3 backPos = getElement2DNormalized(_exitPoints, _exitParams, p).rgb; + vec3 frontPos = texture(_entryPoints, p).rgb; + vec3 backPos = texture(_exitPoints, p).rgb; //determine whether the ray has to be casted if (frontPos == backPos) { diff --git a/modules/vis/glsl/sliceextractor.frag b/modules/vis/glsl/sliceextractor.frag index 901a139807e69337240daee69e14d814ec148f05..19c4377896f4c390bc451bc1d906f0079523de45 100644 --- a/modules/vis/glsl/sliceextractor.frag +++ b/modules/vis/glsl/sliceextractor.frag @@ -47,7 +47,7 @@ uniform vec4 _color; void main() { if (_useTexturing) { - vec4 texel = getElement3DNormalized(_texture, _textureParams, (_texCoordsMatrix * vec4(ex_TexCoord, 1.0)).xyz); + vec4 texel = texture(_texture, (_texCoordsMatrix * vec4(ex_TexCoord, 1.0)).xyz); if (_textureParams._numChannels == 1) { out_Color = lookupTF(_transferFunction, _transferFunctionParams, texel.r); diff --git a/modules/vis/glsl/slicerenderer3d.frag b/modules/vis/glsl/slicerenderer3d.frag index e378d4c63038bf8b0aca239c29d091e8136350d2..d7d77c467215552883b8e3a578978b83af85c2c3 100644 --- a/modules/vis/glsl/slicerenderer3d.frag +++ b/modules/vis/glsl/slicerenderer3d.frag @@ -40,7 +40,7 @@ uniform sampler1D _transferFunction; uniform TFParameters1D _transferFunctionParams; void main() { - float intensity = getElement3DNormalized(_texture, _textureParams, ex_TexCoord).r; + float intensity = texture(_texture, ex_TexCoord).r; out_Color = lookupTF(_transferFunction, _transferFunctionParams, intensity); // don't write fragment if fully transparent (in particular don't write to depth buffer!) diff --git a/modules/vis/glsl/virtualmirrorcombine.frag b/modules/vis/glsl/virtualmirrorcombine.frag index f93b1570265825df5e7769238e0c92d19b96e7c1..0af6c68f767d30f6e499ff7489d6968d2386a389 100644 --- a/modules/vis/glsl/virtualmirrorcombine.frag +++ b/modules/vis/glsl/virtualmirrorcombine.frag @@ -45,16 +45,16 @@ uniform sampler2D _mirrorRenderedDepth; uniform TextureParameters2D _mirrorRenderedTexParams; void main() { - float normalDepth = getElement2DNormalized(_normalDepth, _normalTexParams, ex_TexCoord.xy).r; - float mirrorRenderedDepth = getElement2DNormalized(_mirrorRenderedDepth, _mirrorRenderedTexParams, ex_TexCoord.xy).r; + float normalDepth = texture(_normalDepth, ex_TexCoord.xy).r; + float mirrorRenderedDepth = texture(_mirrorRenderedDepth, ex_TexCoord.xy).r; if (normalDepth <= mirrorRenderedDepth) { - out_Color = getElement2DNormalized(_normalColor, _normalTexParams, ex_TexCoord.xy); + out_Color = texture(_normalColor, ex_TexCoord.xy); gl_FragDepth = normalDepth; } else { - out_Color = getElement2DNormalized(_mirrorColor, _mirrorTexParams, ex_TexCoord.xy); - gl_FragDepth = getElement2DNormalized(_mirrorDepth, _mirrorTexParams, ex_TexCoord.xy).r; + out_Color = texture(_mirrorColor, ex_TexCoord.xy); + gl_FragDepth = texture(_mirrorDepth, ex_TexCoord.xy).r; } if (out_Color.a == 0) {