Fixed exceptions when trying to render LOS with no convex hulls within the view
This commit is contained in:
@@ -309,14 +309,19 @@ namespace Barotrauma.Lights
|
|||||||
penumbraVerts.AddRange(convexHull.PenumbraVertices);
|
penumbraVerts.AddRange(convexHull.PenumbraVertices);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConvexHull.shadowEffect.World = shadowTransform;
|
if (shadowVerts.Count > 0)
|
||||||
ConvexHull.shadowEffect.CurrentTechnique.Passes[0].Apply();
|
{
|
||||||
graphics.DrawUserPrimitives(PrimitiveType.TriangleList, shadowVerts.ToArray(), 0, shadowVerts.Count / 3, VertexPositionColor.VertexDeclaration);
|
ConvexHull.shadowEffect.World = shadowTransform;
|
||||||
|
ConvexHull.shadowEffect.CurrentTechnique.Passes[0].Apply();
|
||||||
ConvexHull.penumbraEffect.World = shadowTransform;
|
graphics.DrawUserPrimitives(PrimitiveType.TriangleList, shadowVerts.ToArray(), 0, shadowVerts.Count / 3, VertexPositionColor.VertexDeclaration);
|
||||||
ConvexHull.penumbraEffect.CurrentTechnique.Passes[0].Apply();
|
|
||||||
graphics.DrawUserPrimitives(PrimitiveType.TriangleList, penumbraVerts.ToArray(), 0, penumbraVerts.Count / 3, VertexPositionTexture.VertexDeclaration);
|
|
||||||
|
|
||||||
|
if (penumbraVerts.Count > 0)
|
||||||
|
{
|
||||||
|
ConvexHull.penumbraEffect.World = shadowTransform;
|
||||||
|
ConvexHull.penumbraEffect.CurrentTechnique.Passes[0].Apply();
|
||||||
|
graphics.DrawUserPrimitives(PrimitiveType.TriangleList, penumbraVerts.ToArray(), 0, penumbraVerts.Count / 3, VertexPositionTexture.VertexDeclaration);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
graphics.SetRenderTarget(null);
|
graphics.SetRenderTarget(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user