Compiling error of texture3D

There’s a compiling error in the following geometry shader:

error C1101: ambiguous overloaded function reference “texture3D(sampler3D, vec3)”
(0) : gp4 fp50 vp50 cp50 gp50 uvec4 texture3D(usampler3D, vec3)
(0) : gp4 fp50 vp50 cp50 gp50 ivec4 texture3D(isampler3D, vec3)


// these lines enable the geometry shader support.
#version 150
#extension GL_ARB_geometry_shader4 : enable
uniform sampler3D Diagonal;
void main( void )
{
vec4 CurCoord = gl_PositionIn[0];
vec3 vDiagonal = texture3D(Diagonal,CurCoord.xyz).xyz;
}

vec3 vDiagonal = texture(Diagonal,CurCoord.xyz).xyz;

or

vec4 vDiagonal4 = texture(Diagonal,CurCoord.xyz);
vec3 vDiagonal = vDiagonal4.xyz;

I think texture3D has been deprecated, use texture function instead.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.