문제

I would like to see an example of rendering with nVidia Cg to an offscreen frame buffer object.

The 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)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top