Lighting optimization (caching shadow vertices & only checking hulls in range if the position or range of the light changes), ragdoll optimization, itemcomponent optimization, dragging stunned/dead characters

This commit is contained in:
Regalis11
2015-10-11 21:04:42 +03:00
parent 0a96254696
commit 8df9133e84
25 changed files with 377 additions and 201 deletions
+4 -12
View File
@@ -158,7 +158,7 @@ namespace Subsurface
public void DrawMap(GraphicsDevice graphics, SpriteBatch spriteBatch)
{
GameMain.LightManager.DrawLightmap(graphics, spriteBatch, cam);
if (GameMain.LightManager.LightingEnabled) GameMain.LightManager.DrawLightmap(graphics, spriteBatch, cam);
//----------------------------------------------------------------------------------------
//1. draw the background, characters and the parts of the submarine that are behind them
@@ -267,17 +267,7 @@ namespace Subsurface
}
Hull.renderer.Render(graphics, cam, renderTargetAir, Cam.ShaderTransform);
spriteBatch.Begin(SpriteSortMode.BackToFront,
BlendState.AlphaBlend, SamplerState.LinearWrap,
null, null, null,
cam.Transform);
Submarine.DrawFront(spriteBatch);
spriteBatch.End();
if (GameMain.GameSession != null && GameMain.GameSession.Level != null)
{
GameMain.GameSession.Level.Render(graphics, cam);
@@ -303,6 +293,8 @@ namespace Subsurface
foreach (Character c in Character.CharacterList) c.DrawFront(spriteBatch);
Submarine.DrawFront(spriteBatch);
if (GameMain.GameSession != null && GameMain.GameSession.Level != null)
{
GameMain.GameSession.Level.Draw(spriteBatch);