2
\$\begingroup\$

texelFetch() exists to access texture data with texture coordinates in "image dimensions", but texelFetch skips filtering.

In case of 2D textures, it's possible to use a rectangle texture sampler to access textures without normalized coordinates with filtering, but the same equivalent doesn't seem to exist for 3D textures.

Is this somehow possible with 3D textures?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

If your OpenGL version is new enough you can use the textureSize intrinsic to get the dimensions of the texture: http://www.opengl.org/sdk/docs/manglsl/xhtml/textureSize.xml Then you can divide your pixel coordinate by this to get the UV to sample at for that pixel.

If not you can just pass it as uniform but that may not be as clean depending on how your code is setup.

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.