我遇到了一個問題,試圖呈現多個alpha對象在彼此的頂部。此刻,如果我在另一個alpha對象頂部渲染一個alpha對象,則會顯示頂部alpha對象,但底部對象不會顯示,直到您經過/圍繞第一個對象。我試圖得到一個添加混合效果,所以頂層對象顯示在它後面還有另一個透明對象。你如何做到這一點在XNA? 我現在的渲染狀態設置爲:XNA呈現多個Alpha問題
RenderState rs = Globals.g_Device.RenderState;
rs.AlphaBlendEnable = true;
rs.BlendFunction = BlendFunction.Add;
rs.DepthBufferFunction = CompareFunction.LessEqual;
rs.DepthBufferEnable = true;
rs.DepthBufferWriteEnable = true;
Globals.g_Device.PresentationParameters.EnableAutoDepthStencil = true;
Globals.g_Device.PresentationParameters.AutoDepthStencilFormat = DepthFormat.Depth24Stencil8;