Rendering to 3D textures?

Started by
1 comment, last by HellRaiZer 15 years, 6 months ago
Hi! I've read that on the GeForce 8800 it is possible to render to a 3D texture using an FBO. (i don't have an 8800 so i can't test it) I'm a bit confused about what this means exactly. Is it:
  • the fragment shader can render to any slice of the 3D texture during a single pass (i.e. 3D instead of 2D) (The entire 3D texture is attached to the FBO and maybe the shader selects which one to render to)
  • the fragment shader can only render to one 2D slice per pass (i.e. still just 2D, like for 2D textures) (Only one slice of the 3D texture is attached to the FBO)
? I haven't really been able to find any info on it, except for other people asking this question :) It would be really cool if it was now possible to truely render to a 3D texture, instead of just rendering to a slice
Advertisement
I've skimmed the extension in the past some time, from memory I think you only bind a single layer (i.e. one Z value) of the 3d texture at a time, so the fragment shader still acts as usual (outputting to a 2D buffer).
I think you can render to any slice of a 3D texture by using geometry shaders to select the slice while having the 3D texture bound using glFramebufferTextureEXT (GL_EXT_geometry_shader4)

Quote:From the specs
Section 2.16.4, Geometry Shader Execution Environment

...

Layered rendering

Geometry shaders can be used to render to one of several different layers of cube map textures, three-dimensional textures, plus one- dimensional and two-dimensional texture arrays. This functionality allows an application to bind an entire "complex" texture to a framebuffer object, and render primitives to arbitrary layers computed at run time. For example, this mechanism can be used to project and render a scene onto all six faces of a cubemap texture in one pass. The layer to render to is specified by writing to the built-in output variable gl_layer. Layered rendering requires the use of framebuffer objects.


I don't have an 8x00 so i haven't tried it.

HellRaiZer
HellRaiZer

This topic is closed to new replies.

Advertisement