Sign in to follow this  
ehmdjii

render certain objects to texture/file

Recommended Posts

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!

Share this post


Link to post
Share on other sites
if ( takescreenshot )
{
glClear( GL_COLORBUFFER );
draw player
readpixels + save to file
}

Share this post


Link to post
Share on other sites
You'll lose antialiasing on the result image if you use FBOs. Using ReadPixels is probably the most reliable way to go about it.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this