[:arrow_backward:](glsl.md) [:arrow_double_up:](../README.md) [:arrow_up_small:](#) [:arrow_down_small:](#copyright) [:arrow_forward:](texturing.md) # 3D Game Shaders For Beginners ## Render To Texture Instead of rendering/drawing/painting directly to the screen, the example code uses a technique called "render to texture". In order to render to a texture, you'll need to set up a framebuffer and bind a texture to it. Multiple textures can be bound to a single framebuffer. The textures bound to the framebuffer hold the vector(s) returned by the fragment shader. Typically these vectors are color vectors `(r, g, b, a)` but they could also be position or normal vectors `(x, y, z, w)`. For each bound texture, the fragment shader can output a different vector. For example you could output a vertex's position and normal in a single pass. Most of the example code dealing with Panda3D involves setting up [framebuffer textures](https://www.panda3d.org/manual/?title=Render-to-Texture_and_Image_Postprocessing). To keep things straightforward, nearly all of the fragment shaders in the example code have only one output. However, you'll want to output as much as you can each render pass to keep your frames per second (FPS) high. There are two framebuffer texture setups found in the example code.