Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GLSL -- texture1D is deprecated, what to use instead?

I'm writing a GLSL shader to #version 130 (OpenGL 3.0)

It gives a warning that "global function texture1D is deprecated after version 120"

I've googled but can't find much. If it's deprecated, then what should I be using that provides similar functionality?

like image 686
HoboBen Avatar asked Jun 10 '13 07:06

HoboBen


1 Answers

In modern GLSL the deprecated texture1D/2D/3D/Shadow functions have been replaced by a general texture function (and likewise for the ...Proj versions and the like) overloaded for all possible sampler types, whose actual dimensionality and type is just determined by the sampler argument. So just leave away the 1D and you're done.

like image 81
Christian Rau Avatar answered Nov 03 '22 02:11

Christian Rau