-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add option to show particle effects in WorldViewer (#42)
* add option to show particle effects in WorldViewer * significant performance increases to Particle.Update() * . * 1000x performance increase to Particle.Draw via batching / instancing * add missing call to init emitters * fix issues with some emitters blinking out for 1 frame * update version info
- Loading branch information
Showing
27 changed files
with
962 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace ACViewer.Enum | ||
{ | ||
public enum ProfilerSection | ||
{ | ||
Draw, | ||
ParticleUpdate, | ||
ParticleDraw | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Numerics; | ||
|
||
using Microsoft.Xna.Framework.Graphics; | ||
|
||
namespace ACViewer | ||
{ | ||
public struct ParticleDeclaration : IVertexType | ||
{ | ||
// per-particle data | ||
// align to 16? | ||
|
||
public Vector3 Position; | ||
|
||
public Vector3 BillboardTexture; // pointSpriteSizeX = u, pointSpriteSizeY = v, textureIdx = w | ||
public Vector3 ScaleOpacityActive; // scale = x, opacity = y, active = z | ||
|
||
public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration | ||
( | ||
// VertexElementUsage.PointSize for base? | ||
new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 1), | ||
new VertexElement(sizeof(float) * 3, VertexElementFormat.Vector3, VertexElementUsage.TextureCoordinate, 1), | ||
new VertexElement(sizeof(float) * 6, VertexElementFormat.Vector3, VertexElementUsage.Position, 2) | ||
); | ||
|
||
public ParticleDeclaration(int textureIdx, Vector2 dims) | ||
{ | ||
Position = Vector3.Zero; | ||
BillboardTexture = new Vector3(dims.X, dims.Y, textureIdx); | ||
ScaleOpacityActive = Vector3.Zero; | ||
} | ||
|
||
VertexDeclaration IVertexType.VertexDeclaration => VertexDeclaration; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.