Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

What does the texture() function in GLSL do?

$
0
0

Hi there,

Actually, is not combining the two, per se, but accessing the texture in a given position and returning the color in normalised RGBA (this is important, the output color in GLSL ranges from 0 to 1, not 0 to 255). It's a lookup function.

sampler2DRect means that the texture is in texel space. That is, it ranges from 0 to its size.
texcoord it's the variation of that fragment.

So, it's like using a getColor(x, y) function with pixels. Sort of. :smile:


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>