more sprite mesh rendering

sprite_light_experimental
cosmonaut 2020-12-12 03:20:55 -08:00
parent 9bd7f84d26
commit c69e659ba5
1 changed files with 18 additions and 2 deletions

View File

@ -199,11 +199,12 @@ namespace Kav
public void RenderMeshSpriteGBuffer(
RenderTargetBinding[] gBuffer,
PerspectiveCamera camera,
IEnumerable<MeshSpriteDrawData> meshSpriteDrawDatas
IEnumerable<MeshSpriteDrawData> meshSpriteDrawDatas,
DepthStencilState depthStencilState
) {
GraphicsDevice.SetRenderTargets(gBuffer);
GraphicsDevice.RasterizerState = RasterizerState.CullNone;
GraphicsDevice.DepthStencilState = DepthStencilState.Default;
GraphicsDevice.DepthStencilState = depthStencilState;
GraphicsDevice.BlendState = BlendState.AlphaBlend;
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(
RenderTarget2D renderTarget,
PerspectiveCamera camera,