Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / Zooming a portion of the screen Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
NeilD

April 03, 2005, 05:02 PM

I'm trying to zoom up part of the screen (a full screen directx app) and I wanted to use GetRenderTargetData() to copy the back buffer to a texture to achieve this (by rendering the texture, or a portion of it, at a larger size), but I can't get it work.

Does anyone know how I can do this, and if there are any restrictions? Alternatively is there another method I can use?

 
Reedbeta

April 03, 2005, 08:56 PM

You can use the projection matrix to zoom, just set the frustum left/right/top/bottom parameters to bracket the area you want to zoom in on.

 
NeilD

April 04, 2005, 05:31 PM

Just to clarify - I mean overlay a zoomed copy of a small area of the already rendered scene - literally a magnified view of part of the screen, with blocky zooomed up pixels.

 
bovicide

April 04, 2005, 05:53 PM

What are you rendering the data to? maybe you could show a small segment of code...

 
NeilD

April 09, 2005, 06:32 AM

Maybe I should have asked a more general question - I just want to take the current contents of the back buffer and use the image for further rendering. An exmaple would be to use it as a texture on a model for example. GetRenderTargetData() seems to be the way to capture the back buffer but I can't get it to work.

 
Kurt Miller

April 09, 2005, 09:36 AM

NeilD wrote: Maybe I should have asked a more general question - I just want to take the current contents of the back buffer and use the image for further rendering. An exmaple would be to use it as a texture on a model for example. GetRenderTargetData() seems to be the way to capture the back buffer but I can't get it to work.


I've done this before, though its not exactly fast. Make sure that the destination (texture/surface) you're trying to copy to with GetRenderTargetData is in system memory, otherwise it'll fail. If you want to render with that data later, you'll need to copy it again to a texture/surface accessible by the Direct3D device-- for instance, look at the function IDirect3DDevice9::UpdateTexture.

I don't know exactly what you want this for, but I'd recommend looking at alternatives to copying from the back buffer directly.

 
Erik Faye-Lund

April 09, 2005, 01:45 PM

you can allways copy the portion of the backbuffer you need to a texture and use it for further rendering... atleast it's a bit faster.

check out IDirect3DDevice9::StretchRect() or something....

 
This thread contains 7 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.