Jump to content

  • Log In with Google      Sign In   
  • Create Account


StretchRect() Discrepancy


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Endemoniada   Members   -  Reputation: 291

Like
0Likes
Like

Posted 13 February 2012 - 06:10 PM

Hi guys, using a checker pattern I did a test like this:

// shrink
d3dDevice->StretchRect(renderTarget,NULL,auxSurface,NULL,D3DTEXF_LINEAR);

// expand to original size
d3dDevice->StretchRect(auxSurface,NULL,renderTarget,NULL,D3DTEXF_LINEAR);

The checker boxes get smaller and smaller from left to right and top to bottom. The smaller surface is exactly 25% of the original (1280x800 to 320x200).

I plan on shrinking, blurring, then expanding for a bloom effect. Should I be using StretchRect() for that ?

Thanks.

Sponsor:

#2 MJP   Moderators   -  Reputation: 10282

Like
0Likes
Like

Posted 13 February 2012 - 06:55 PM

I plan on shrinking, blurring, then expanding for a bloom effect. Should I be using StretchRect() for that ?


No, just use a full screen quad or triangle + a pixel shader.

#3 Endemoniada   Members   -  Reputation: 291

Like
0Likes
Like

Posted 13 February 2012 - 09:22 PM

No, just use a full screen quad or triangle + a pixel shader.


I plan on using a pixel shader for the blur. Most of the articles I've read say you should reduce the dimensions of the surface before you do a blur.

#4 MJP   Moderators   -  Reputation: 10282

Like
1Likes
Like

Posted 13 February 2012 - 11:39 PM

Yes, what I meant was that you should render a quad if you want to downscale before doing a blur as opposed to using StretchRect.

#5 Tispe   Members   -  Reputation: 978

Like
0Likes
Like

Posted 14 February 2012 - 09:54 AM

Do you mind sharing the "bloom" tutorial? :)

#6 Endemoniada   Members   -  Reputation: 291

Like
0Likes
Like

Posted 15 February 2012 - 09:31 PM

Yes, what I meant was that you should render a quad if you want to downscale before doing a blur as opposed to using StretchRect.


Thank you. If you didn't clear that up for me I would have still been using StretchRect(). Everything works much better with the quads.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS