Texture Access from Fragment Shader

Hi, new to shaders so please bear with me. What I’m wondering is does the fragment shader have access to 3d textures, both to read and more importantly write to one? I am trying to modify the texture information depending on the fragment result, is this at all possible?

Thank You

Yes, you can access 1D, 2D, 3D, cubemap and rectangle textures in a fragment shader/program.

The only output from your shader is the fragment color, you cannot modify the texture from within the shader.

What you can do is setup your rendering to draw into a texture (using GL_EXT_framebuffer_object or WGL_ARB_pbuffer+WGL_ARB_render_texture) so that the output of your shader goes into a texture.

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