Computer Graphics

Moderators: Sephiroth
Number of threads: 1263
Number of posts: 2665

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
a question about 3d application and GPU's Posted by afterdeath on 19 Jun 2003 at 7:39 AM
Hi, I am working on a 3d engine, but i want to have all my rendered data saved to the harddisk instead of the screen as i need to send it to another computer which will view the scene, I want the scene to be rendered in real time and sent out. my question is, is it possible to use the capabilities of the card for the rendering and then save it to the Hard disk?

thank you

Afterdeath
Report
Re: a question about 3d application and GPU's Posted by XLoom on 19 Jun 2003 at 10:00 AM
It is possible to render the scene and save it to hard disk. Are you using OpenGL or DirectX or ... I think you are not coding low level functions or you wouldn't be asking this? If you use OpenGL you can use

void glCopyTexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLint xCoordinate,
GLint yCoordinate,
GLsizei width,
GLsizei height)

(Precise description about this function can be found from for example http://molt.zdv.uni-mainz.de/doc_link/en_US/a_doc_lib/libs/openglrf/glCopyTexSubImage2D.htm#F2uDp1fcbolt)

to get your scene into OpenGL texture and then use

void glGetTexImage(GLenum Target,
GLint Level,
GLenum Format,
GLenum Type,
GLvoid *Pixels)
(Precise description about this function can be found from
http://molt.zdv.uni-mainz.de/doc_link/en_US/a_doc_lib/libs/openglrf/glGetTexImage.htm
Google search :)

to get pixels into your own array of same type as OpenGL texture (RGB or RGBA or indexed color or whatever type it is)

Then you can save your array into a file.

At least I think it should work this way. If I am wrong about something, then please let me know, I am also in the middle of game creation, but I am not so familiar with OpenGL as I would like to be.

Anyway I hope it helps you.

XLoom



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.