SouLDragooN

I am having a problem here. In PC development I love the availablity of StretchRect. You can render an entire scene at a high resolution then stretch it to a low res map to create all sort of fun effects. The problem is XNA does not support stretch rect ... so then is the only option to:

A. Render the whole scene to a render target and use it to create lower render targets for use in effects. (Currently using)

Pros:
1. Very Fast.
2. Only 1 scene render
Cons:
1. Locked to texture resolutions 1024x1024 or 512x 512
2. Will never be a perfect monitor resolution match thus muddy areas will always be there.

B. Render the whole scene once at full rez then render it a second time to a Render target for effects.

Pros:
1. Good resolution for the first render since it is full back buffer size
2. Should not have muddy areas with the correct resultion match to the monitor setting.
Cons:
1. Very slow with the second render of a scene. Culling and forced lower mips could be used but what a hassle...
2. Pretty much not an option without stretch rect and a quick way of copying the back buffer.

I am using option A I was wondering what most others are doing about the lack of stretch rect and any other ideas =)...

Thanks...



Re: XNA Framework Render Target For Effects.

Shawn Hargreaves - MSFT

Why do you say your texture needs to be 512 or 1024 Modern graphics cards support rendertargets of any size you like.

If you want to run on really old cards that only supported power of two sizes (which I'd tend to not worry about since those are so rare these days) you can still render any size you like: just make a rendertarget the next bigger power of two to what you want, and set the viewport so you only draw onto the top left portion of it.





Re: XNA Framework Render Target For Effects.

SouLDragooN

All very true..

I am looking for the best cross the board cross the platform performance ( thus the power 2 for PC, though I am not sure if all XNA compatible cards make that a non issue ).... I am creating a kids game for PC.... but I do want to be able to go to the box if a marketing platform somehow was setup in the future for hobbyist/indies to get some sort of return on months of invested time...

The question was aimed at if there were other options I am unaware of with XNA. The larger Render Target might be the option to take to get the best result. Only losing a little memory to the unused target texture area.

Thank you for the reply.





Re: XNA Framework Render Target For Effects.

Shawn Hargreaves - MSFT

You could also check the caps bits for non-power-of-two texture support, and only use the rounded up size if the hardware doesn't directly support the size you want.





Re: XNA Framework Render Target For Effects.

SouLDragooN

Thanks again... and thanks even more for XNA .. the best medium I have worked in