Optimized GameScreen.DrawMap

- Downscaled lightmap, since blurring will make this unnoticeable anyway
(TODO: make this optional)
- Render LOS in fewer passes by using a shader
- Use light volume to calculate LOS
- This also means we can use the override texture to render the diving
suit obstruct effect
- Don't render bunks and labels onto LOS background (TODO: add the
option to render back into the LOS background, i.e. just use
multiplicative blending as if it was the lightmap)
- Prefer SpriteSortMode.Deferred over all others, prefer
SamplerState.LinearClamp/PointClamp over all others
- Remove shader blur in favor of geometry blur (TODO: improve on this
further, right now it has a few artifacts)
- Trim light volumes
- Do some weird shit with the background particles (use DrawTiled
instead of relying on SamplerState.LinearWrap, because that's faster
somehow :/ )
- Pressing up/down in the console only returns a typed command now
This commit is contained in:
juanjp600
2017-12-20 19:41:23 -03:00
parent 1cb39f7fd5
commit 7a413aee93
30 changed files with 1986 additions and 1960 deletions
@@ -1,4 +1,4 @@
using Barotrauma.Lights;
using Barotrauma.Lights;
using Barotrauma.Particles;
using Microsoft.Xna.Framework;
using System;
@@ -76,9 +76,9 @@ namespace Barotrauma
}
}
lightSource.Range = Math.Max(size.X, size.Y) * 10.0f / 2.0f;
lightSource.Color = new Color(1.0f, 0.45f, 0.3f) * Rand.Range(0.8f, 1.0f);
lightSource.Position = position + Vector2.UnitY * 30.0f;
if (Math.Abs((lightSource.Range * 0.2f) - Math.Max(size.X, size.Y)) > 1.0f) lightSource.Range = Math.Max(size.X, size.Y) * 5.0f;
if (Vector2.DistanceSquared(lightSource.Position,position) > 5.0f) lightSource.Position = position + Vector2.UnitY * 30.0f;
if (size.X > 256.0f)
{