Sign in to follow this  

reduced texture

This topic is 4816 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

okay the problem: im trying to get a low res image of the screen in to the accumulation buffer eg. my screen might be 800x600 i want an image size 400x300 capture of the screen stretched to 800x600 in the accumulation buffer. my origonal ideas was: use glCopyTexImage2D or glCopyTexSubImage2D to a 400x300 texture, but this only copies the top left 400x300 pixels and not the whole screen as intended :-/ so my new idea: copy the screen to a 800x600 texture, render it to the back buffer as 400x300 pixel quad. then copy this to a 400x300 texture then render it back to the back buffer as 800x600 quad then copy to accum buffer, but this sounds like a lot of work for a simple task :-/ is there some easy way to do this, with out to much copying going on?

Share this post


Link to post
Share on other sites
set the viewport to the smaller window (glViewport), render as normal and then copy the correct size, set viewport back to normal.

HTH

Share this post


Link to post
Share on other sites
or you could use a P-Buffer and avoid the readback (for a speedup)

ATI have an excelent wrapper on their website (should work for NV as long as you dont want a float one)

i think i got it from the Mandelbrot sample, its piss easy to use.

http://www.ati.com/developer/

Share this post


Link to post
Share on other sites
but if i already have the scene rendered in a higher res, and want a lower res version.

I dont really have to want to render the scene 2 times? or could i just render my high res using a quad, to a lower res pbuffer? then can i copy from pbuffer to accumulation buffer?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I don't exactly know how to help... but can't you make OpenGL skip every other byte when copying? That would give you exactly half the size. Although, this may not work, just an idea.

Share this post


Link to post
Share on other sites
Quote:
Original post by supagu
but if i already have the scene rendered in a higher res, and want a lower res version.

I dont really have to want to render the scene 2 times? or could i just render my high res using a quad, to a lower res pbuffer? then can i copy from pbuffer to accumulation buffer?


Yes, u just render the scene to a texture(hign res), and map the texture to a quad, which only takes up half res of the high res screen, and then render the quad, glCopyTexSubImage2D the specific screen buffer(only contains the quad) to another texture. done!
but u need to carefully adjust the size of the quad to make it only take up res 400*300 on the high res(800*600) screen

or as u suggested, render the mapped screen quad to a low res p-buffer.

Share this post


Link to post
Share on other sites

This topic is 4816 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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