I've been dabbling with XNA for a couple of days now. This chunk of code doesn't work as I expect. The goal is to render sprites individually and composite them on another rendertarget.

P = RenderTarget2D(with RenderTargetUsage.PreserveContents)
D = RenderTarget2D(with RenderTargetUsage.DiscardContents)

for all sprites:
{
    graphicsDevice.SetRenderTarget(D);
    &lt;draw sprite i&gt;

    graphicsDevice.SetRenderTarget(P);
    &lt;Draw D&gt;
}

graphicsDevice.SetRenderTarget(null);
&lt;Draw P&gt;


The result I get is - only the last sprite is visible. I'm sure I'm missing some piece of information about RenderTarget2D. Any hints on what that might be?


Question: What is the best introductory Bayesian statistics textbook?
Answer: I read:

Gelman et al (2013). Bayesian Data Analysis. CRC Press LLC. 3rd ed.

Hoff, Peter D (2009). A First Course in Bayesian Statistical Methods. Springer Texts in Statistics.

Kruschke, Doing Bayesian Data Analysis: A Tutorial with R and Bugs, 2011. Academic Press / Elsevier.

and I think that the better one to start with is Kruschke's book. It's perfect for a first approach to Bayesian thinking: concepts are explained very clearly, there is not too much mathematics, and there are lots of nice examples!

Gelman et al. is a great book, but it is more advanced and I suggest to read it after the Kruschke's one.

Conversely, I did not like Hoff's book because it is an introductory book, but concepts (and Bayesian thinking) are not explained in a clear way. I suggest to pass over.