Add blend modes to renderer.

This commit is contained in:
2024-10-15 17:10:48 +02:00
parent 851abd7c90
commit ecd752e961
5 changed files with 62 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
[ParticleEmitterSettings]
MaxParticles = 1024
EmitRadius = 128
EmitRadius = 3
LifeTime = 0.5
Direction = { x = 0.0, y = 1.0 }
LinearVelocity = 980.0

View File

@@ -74,6 +74,8 @@ public class TestGame : Game
private void DrawEmitter(ParticleEmitter emitter)
{
Renderer.BeginBlended(Voile.Rendering.BlendMode.BlendAdd);
for (int i = 0; i < emitter.Particles.Length; i++)
{
var particle = emitter.Particles[i];
@@ -83,6 +85,8 @@ public class TestGame : Game
Renderer.SetTransform(emitter.OriginPosition + particle.Position, Vector2.Zero);
Renderer.DrawCircle(16f * particle.Scale, color);
}
Renderer.EndBlended();
}
private ParticleSystem? _particleSystem;