Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

The IDirect3DDevice9::Clear method

4: Adsense

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
3 replies to this topic

#1 Tispe   Members   

1468
Like
0Likes
Like

Posted 06 February 2014 - 11:28 AM

This might be a stupid question but does the Clear method only clear the current render targets?

 

The documentation says: "Clears one or more surfaces such as a render target, multiple render targets, a stencil buffer, and a depth buffer. [...] Use this method to clear a surface including: a render target, all render targets in an MRT, a stencil buffer, or a depth buffer. Flags determines how many surfaces are cleared. Use pRects to clear a subset of a surface defined by an array of rectangles."

 

If I set 4 render targets and call Clear(), will all these surfaces be cleared?

 

If I build a shadow map on a different render surface, then only if the pointer to the shadow map is taken off the MRT list it will not be cleared?



#2 cgrant   Members   

1789
Like
1Likes
Like

Posted 06 February 2014 - 12:53 PM


If I set 4 render targets and call Clear(), will all these surfaces be cleared?


Yes..


If I build a shadow map on a different render surface, then only if the pointer to the shadow map is taken off the MRT list it will not be cleared?


Try not to thing of in terms of pointers to render target, think in terms of rendertarget bound to the device. For MRT, if the render target is not written to via a shader, its content will remain the same, unless in your case you call Clear.

#3 cozzie   Members   

4971
Like
1Likes
Like

Posted 07 February 2014 - 05:40 PM

http://msdn.microsoft.com/en-us/library/windows/desktop/bb172514(v=vs.85).aspx

 

 

D3DCLEAR_TARGET Clear a render target, or all targets in a multiple render target. See Multiple Render Targets (Direct3D 9).

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me


#4 mhagain   Members   

13161
Like
0Likes
Like

Posted 08 February 2014 - 07:32 AM

 

http://msdn.microsoft.com/en-us/library/windows/desktop/bb172514(v=vs.85).aspx

 

 

D3DCLEAR_TARGET Clear a render target, or all targets in a multiple render target. See Multiple Render Targets (Direct3D 9).

 

 

When all else fails, read the documentation. :)


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





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.