<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>XNA rendertarget semantics</title><link>http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx</link><description>The way rendertargets work in XNA is somewhat different to regular DirectX, and although we've already discussed most of the details in various forum threads, I recently noticed there doesn't seem to be any one place that explains everything all together</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: XNA rendertarget semantics</title><link>http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx#1600605</link><pubDate>Mon, 05 Feb 2007 03:55:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1600605</guid><dc:creator>JoelMartinez</dc:creator><description>&lt;p&gt;ahh, good deal ... I was curious about using this for some post processing, but couldn't really find any coherent data in one place (as you alluded to). &amp;nbsp;thanks Shawn&lt;/p&gt;
</description></item><item><title>re: XNA rendertarget semantics</title><link>http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx#1605732</link><pubDate>Mon, 05 Feb 2007 21:46:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1605732</guid><dc:creator>CatalinZima</dc:creator><description>&lt;p&gt;Thanks! This clears up some things.&lt;/p&gt;
&lt;p&gt;I was especially curios about the cost of resolving the render target.&lt;/p&gt;
</description></item><item><title>re: XNA rendertarget semantics</title><link>http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx#1609253</link><pubDate>Tue, 06 Feb 2007 07:35:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1609253</guid><dc:creator>Jamezilla</dc:creator><description>&lt;p&gt;This blog post is kind of troublesome, because I got some post-processing effects going in what I think is the very same way that you say should destroy the textures on the Xbox360, yet they work fine! &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I render the scene to target A, resolve A, switch to target B, render A to B with an effect, resolve B, switch to C, render A to C with an effect, resolve C, then render A, B, and C to the backbuffer. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;This should be destroying everything, but it's not. &amp;nbsp;Works flawlessly on Windows and Xbox360. What gives? &amp;nbsp;Should I repost this on the XNA forum for the general edification of the masses? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks, love your blog!&lt;/p&gt;
</description></item><item><title>re: XNA rendertarget semantics</title><link>http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx#1610036</link><pubDate>Tue, 06 Feb 2007 10:41:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1610036</guid><dc:creator>ShawnHargreaves</dc:creator><description>&lt;p&gt;Sorry, unclear wording on my part there! Your approach seems fine. The thing that is lost when you call resolve is the contents of the buffer that is being rendered onto: the texture that it resolves into (which is returned by GetTexture) will never be lost.&lt;/p&gt;
&lt;p&gt;This is fine:&lt;/p&gt;
&lt;p&gt;- Render to A&lt;/p&gt;
&lt;p&gt;- Resolve A&lt;/p&gt;
&lt;p&gt;- Render to B&lt;/p&gt;
&lt;p&gt;- Resolve B&lt;/p&gt;
&lt;p&gt;- Render A.GetTexture and B.GetTexture to C&lt;/p&gt;
&lt;p&gt;But this is not:&lt;/p&gt;
&lt;p&gt;- Render to A&lt;/p&gt;
&lt;p&gt;- Resolve A&lt;/p&gt;
&lt;p&gt;- Carry on rendering more stuff to A&lt;/p&gt;
&lt;p&gt;No good because the resolve cleared the current contents of the rendertarget!&lt;/p&gt;
</description></item><item><title>re: XNA rendertarget semantics</title><link>http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx#1614142</link><pubDate>Wed, 07 Feb 2007 01:11:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1614142</guid><dc:creator>Jamezilla</dc:creator><description>&lt;p&gt;Now all is clear! &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I like simple diagrams, preferably with lots of pictures, arrows, and colors, and anything beyond that is difficult to fit into my brain...&lt;/p&gt;
&lt;p&gt;Thank you very much!&lt;/p&gt;
&lt;p&gt;I love your blog doubly now!&lt;/p&gt;
</description></item><item><title>re: XNA rendertarget semantics</title><link>http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx#1908236</link><pubDate>Sun, 18 Mar 2007 20:58:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1908236</guid><dc:creator>hr0nix</dc:creator><description>&lt;p&gt;btw, there is no simple way to do such a save/restore for the RenderTargetCube. What should we do in that case?&lt;/p&gt;
</description></item><item><title>re: XNA rendertarget semantics</title><link>http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx#1913276</link><pubDate>Mon, 19 Mar 2007 17:44:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1913276</guid><dc:creator>ShawnHargreaves</dc:creator><description>&lt;p&gt;You should be able to render any individual face of the cubemap texture to the backbuffer, in just the same way you would for a 2D rendertarget. You need a custom pixel shader to do that, but it should be simple enough to write a shader that just grabs pixels from one face of the cubemap.&lt;/p&gt;
&lt;p&gt;Remember that only the texture portion of the RenderTargetCube is truly a cubemap: the current rendertarget is still just a 2D surface, so you are only ever rendering to (and thus only need to worry about restoring) one face of that cubemap at a time.&lt;/p&gt;
</description></item><item><title>re: XNA rendertarget semantics</title><link>http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx#1926790</link><pubDate>Wed, 21 Mar 2007 20:12:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1926790</guid><dc:creator>hr0nix</dc:creator><description>&lt;p&gt;Probably XNA should have more useful RenderTargets and support features like 'RT stacking'. I hope that feature will appear in future releases.&lt;/p&gt;
&lt;p&gt;BTW, what is the lifetime of the resolved texture? I do some rendering into RT, than resolve it, than do some other rendering into another RT, set the previous RT and try to get resolved texture, but i has InvalidOperationException at this time. That was my simple attemp to implement RT stacking myself, and it fails =). Can you give some explanation, please?&lt;/p&gt;
</description></item></channel></rss>