I would like to see an example of rendering with nVidia Cg to an offscreen frame buffer object.
T开发者_开发问答he computers I have access to have graphic cards but no monitors (or X server). So I want to render my stuff and output them as images on the disk. The graphic cards are GTX285.
You need to create an off screen buffer and render to it the same way as you would render to a window.
See here for example (but without Cg) : http://www.mesa3d.org/brianp/sig97/offscrn.htm
Since you have a Cg shader, just enable it the same way as you would render to a window.
EDIT:
For FBO example, take a look here : http://www.songho.ca/opengl/gl_fbo.html but that is not supported by all graphical cards.
You could also render to texture, and then copy the texture to the main memory, but that is not very good (performance wise)
精彩评论