more sprite mesh rendering

main
cosmonaut 2020-12-12 03:20:55 -08:00
parent d537993530
commit 808d50ccc2
1 changed files with 18 additions and 2 deletions

View File

@ -199,11 +199,12 @@ namespace Kav
public void RenderMeshSpriteGBuffer( public void RenderMeshSpriteGBuffer(
RenderTargetBinding[] gBuffer, RenderTargetBinding[] gBuffer,
PerspectiveCamera camera, PerspectiveCamera camera,
IEnumerable<MeshSpriteDrawData> meshSpriteDrawDatas IEnumerable<MeshSpriteDrawData> meshSpriteDrawDatas,
DepthStencilState depthStencilState
) { ) {
GraphicsDevice.SetRenderTargets(gBuffer); GraphicsDevice.SetRenderTargets(gBuffer);
GraphicsDevice.RasterizerState = RasterizerState.CullNone; GraphicsDevice.RasterizerState = RasterizerState.CullNone;
GraphicsDevice.DepthStencilState = DepthStencilState.Default; GraphicsDevice.DepthStencilState = depthStencilState;
GraphicsDevice.BlendState = BlendState.AlphaBlend; GraphicsDevice.BlendState = BlendState.AlphaBlend;
Deferred_GBufferEffect.HardwareInstancingEnabled = false; Deferred_GBufferEffect.HardwareInstancingEnabled = false;
@ -377,6 +378,21 @@ namespace Kav
); );
} }
public void RenderDepthIndexed<T>(
RenderTarget2D renderTarget,
PerspectiveCamera camera,
T drawable,
DepthStencilState depthStencilState
) where T : IIndexDrawable {
GraphicsDevice.SetRenderTarget(renderTarget);
GraphicsDevice.DepthStencilState = depthStencilState;
SimpleDepthEffect.View = camera.View;
SimpleDepthEffect.Projection = camera.Projection;
RenderIndexed(GraphicsDevice, drawable, SimpleDepthEffect);
}
public void RenderSkybox( public void RenderSkybox(
RenderTarget2D renderTarget, RenderTarget2D renderTarget,
PerspectiveCamera camera, PerspectiveCamera camera,