Skip to main content
gamedev.net
🔒 Locked

render certain objects to texture/file

Started by ehmdjii 5 replies 700+ views
Original Post
ehmdjii
ehmdjii
hello, i would like to implement a feature to my game, that allows players to save a screenshot just of their character without the environment. so i thought of just rendering the character-node of the scenegraph and writing that to a file (PNG). how could i do that? thanks!
zedz
zedz
if ( takescreenshot )
{
glClear( GL_COLORBUFFER );
draw player
readpixels + save to file
}
Promit
Promit
You'll lose antialiasing on the result image if you use FBOs. Using ReadPixels is probably the most reliable way to go about it.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
ehmdjii
ehmdjii
thanks everyone!

why would i loose antialiasing? cant i setup an RGBA texture to render to?
Ingrater
Ingrater
Antialiasing is not supported for fbo's on current hardware except the new gf8 and and (don't know exactly) atis 2000 series. If you stick to readpixels from the framebuffer you can use antialiasing.
http://3d.benjamin-thaut.de
Structural
Structural
And I would like to add that not all hardware supports FBOs (such as cheap Intel chips).
STOP THE PLANET!! I WANT TO GET OFF!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.