On Fri, 22 Feb 2013 12:26:19 -0800, Linda Li wrote:
> I am just now learning GLSL. So if I am wrong, ignore my answer.
>
> Is it possible in the fragment shader to save the color of each pixel into
> one block of memory and then read it out as a texture image?
Saving the colour of each pixel to a block of memory is what fragment
shaders do. Framebuffer objects can be used to render into a texture, or
data can be copied from a non-texture framebuffer to a texture with
e.g. glCopyTexImage2D().
However: this requires that each face in the mesh is rendered to a
distinct set of pixels. That typically won't be the case if you render the
mesh normally. Back faces will be culled, overlapping faces will result in
only the front-most face (or portions thereof) being rendered.
Which is why the mesh has to be "unwrapped" first.