Jump to content

  • Log In with Google      Sign In   
  • Create Account


hlee

Member Since 06 Sep 2013
Offline Last Active Oct 03 2013 11:52 AM
-----

Posts I've Made

In Topic: How to save a scene in higher resolution?

18 September 2013 - 04:38 PM

 

How about using D3DXSaveSurfaceToFile wink.png

That works!  I thought D3DXSaveSurfaceToFile requires the source being OffscreenPlainSurface.

 

That's one step saved.  I still think it is unnecessarily cumbersome.  Maybe D3D11 provide a more efficient method?

 

Just noticed a side effect of skipping the step: the maximum resolution is reduced !

 

Somehow, by copying RT2 to an OffscreenPlainSurface before D3DXSaveSurfaceToFile, I can save a frame with higher resolution.  Does anyone have an explanation?

 

Since efficiency is not a concern for my purpose, I will add the step back.


In Topic: How to save a scene in higher resolution?

18 September 2013 - 03:59 PM

How about using D3DXSaveSurfaceToFile wink.png

That works!  I thought D3DXSaveSurfaceToFile requires the source being OffscreenPlainSurface.

 

That's one step saved.  I still think it is unnecessarily cumbersome.  Maybe D3D11 provide a more efficient method?


In Topic: How to save a scene in higher resolution?

17 September 2013 - 02:59 PM

5. Use D3DXSaveTextureToFile to save RT2 directly to a file

D3DXSaveTextureToFile complains that RT2 is not a texture.  If I'd created RT2 as a texture then StrectRec would complain that RT2 is not a IDirect3DSurface9.  How can I make it to work?


In Topic: How to save a scene in higher resolution?

12 September 2013 - 04:17 PM


The standard solution to that is to use StretchRect() to copy it to a non-multisampled render target.

That's it!  This is what works:

1. Create a large multisampled RT, called it RT1, along with a depth buffer

2. Render the scene to RT1

3. Create a non-multisampled RT, called it RT2, the same size as RT1

4. StretchRect RT1 to RT2

5. Use GetRenderTargetData to copy RT2 to an OffscreenPlainSurce

6. Use D3DXSaveSurfaceToFile to save the OffscreenPlainSurce

 

Now I get a high resolution, multiampled scene.  Thanks so much, Adam!

 

But why does it have to be so cumbersome?  Why can't D3DXSaveSurfaceToFile save a mutisampled RT directly?


In Topic: How to save a scene in higher resolution?

12 September 2013 - 11:41 AM

Great.  Let me know how you do it and if you can turn on anti-aliasing in the high resolution screenshot.


PARTNERS