From c0448fce3e1f183145a5967b56105052821febbc Mon Sep 17 00:00:00 2001 From: reaperrr Date: Tue, 31 Mar 2015 20:44:31 +0200 Subject: [PATCH 1/4] Adds two new BlendModes. --- OpenRA.Game/Graphics/IGraphicsDevice.cs | 13 ++++++++++- OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs | 26 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Graphics/IGraphicsDevice.cs b/OpenRA.Game/Graphics/IGraphicsDevice.cs index 3dde38bad4..fcb356aad0 100755 --- a/OpenRA.Game/Graphics/IGraphicsDevice.cs +++ b/OpenRA.Game/Graphics/IGraphicsDevice.cs @@ -34,7 +34,18 @@ namespace OpenRA public interface IHardwareCursor : IDisposable { } - public enum BlendMode : byte { None, Alpha, Additive, Subtractive, Multiply } + public enum BlendMode : byte + { + None, + Alpha, + Additive, + Subtractive, + Multiply, + SoftAdditive, + Translucency25, + Translucency50, + Translucency75 + } public interface IGraphicsDevice : IDisposable { diff --git a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs index 736270c017..2c866d194f 100755 --- a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs +++ b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs @@ -241,6 +241,32 @@ namespace OpenRA.Renderer.Sdl2 GL.BlendFuncSeparate(BlendingFactorSrc.DstColor, BlendingFactorDest.Zero, BlendingFactorSrc.One, BlendingFactorDest.OneMinusSrcAlpha); ErrorHandler.CheckGlError(); break; + case BlendMode.SoftAdditive: + GL.Enable(EnableCap.Blend); + ErrorHandler.CheckGlError(); + GL.BlendFunc(BlendingFactorSrc.OneMinusDstColor, BlendingFactorDest.One); + break; + case BlendMode.Translucency25: + GL.Enable(EnableCap.Blend); + ErrorHandler.CheckGlError(); + GL.BlendFunc(BlendingFactorSrc.OneMinusConstantAlpha, BlendingFactorDest.One); + ErrorHandler.CheckGlError(); + GL.BlendColor(1f, 1f, 1f, 0.25f); + break; + case BlendMode.Translucency50: + GL.Enable(EnableCap.Blend); + ErrorHandler.CheckGlError(); + GL.BlendFunc(BlendingFactorSrc.OneMinusConstantAlpha, BlendingFactorDest.One); + ErrorHandler.CheckGlError(); + GL.BlendColor(1f, 1f, 1f, 0.5f); + break; + case BlendMode.Translucency75: + GL.Enable(EnableCap.Blend); + ErrorHandler.CheckGlError(); + GL.BlendFunc(BlendingFactorSrc.OneMinusConstantAlpha, BlendingFactorDest.One); + ErrorHandler.CheckGlError(); + GL.BlendColor(1f, 1f, 1f, 0.75f); + break; } ErrorHandler.CheckGlError(); From 10f205b43d821ccdfc729216936148b559e04a35 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Tue, 31 Mar 2015 22:19:40 +0200 Subject: [PATCH 2/4] Reduce brightness of several D2k weapon effects via new blend modes --- mods/d2k/sequences/misc.yaml | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/mods/d2k/sequences/misc.yaml b/mods/d2k/sequences/misc.yaml index ffa1e017c0..c8a216b7f1 100644 --- a/mods/d2k/sequences/misc.yaml +++ b/mods/d2k/sequences/misc.yaml @@ -1,4 +1,6 @@ explosion: + Defaults: + BlendMode: Additive piff: DATA.R8 Start: 3626 Length: 5 @@ -6,64 +8,51 @@ explosion: Start: 3429 Length: 4 Tick: 80 - BlendMode: Additive small_explosion: DATA.R8 Start: 3403 Length: 15 - BlendMode: Additive med_explosion: DATA.R8 Start: 3390 Length: 12 - BlendMode: Additive tiny_explosion: DATA.R8 Start: 3386 Length: 4 Tick: 80 - BlendMode: Additive nuke: DATA.R8 Start: 3965 Length: 14 Tick: 60 - BlendMode: Additive mini_explosion: DATA.R8 Start: 3403 Length: 15 Tick: 60 - BlendMode: Additive self_destruct: DATA.R8 Start: 3433 Length: 15 - BlendMode: Additive building: DATA.R8 Start: 3448 Length: 22 - BlendMode: Additive large_explosion: DATA.R8 Start: 3988 Length: 22 - BlendMode: Additive artillery: DATA.R8 Start: 3988 Length: 22 - BlendMode: Additive small_artillery: DATA.R8 Start: 3390 Length: 12 Tick: 60 - BlendMode: Additive small_napalm: DATA.R8 Start: 3421 Length: 8 - BlendMode: Additive shockwave: DATA.R8 Start: 3687 Length: 6 - BlendMode: Additive Tick: 120 deviator: DATA.R8 Start: 3512 Length: 23 - BlendMode: Additive + BlendMode: SoftAdditive Tick: 80 corpse: DATA.R8 Start: 430 @@ -82,35 +71,35 @@ small_trail: Start: 3735 Length: 4 Tick: 80 - BlendMode: Additive + BlendMode: SoftAdditive small_trail2: idle: DATA.R8 Start: 3540 Length: 4 Tick: 80 - BlendMode: Additive + BlendMode: SoftAdditive bazooka_trail: idle: DATA.R8 Start: 3381 Length: 4 Tick: 80 - BlendMode: Additive + BlendMode: Translucency75 bazooka_trail2: idle: DATA.R8 Start: 3544 Length: 4 Tick: 80 - BlendMode: Additive + BlendMode: Translucency75 deviator_trail: idle: DATA.R8 Start: 3535 Length: 5 Tick: 80 - BlendMode: Additive + BlendMode: SoftAdditive laserfire: idle: DATA.R8 From 883e3822c6249973c89976ae1218f0dd5566818c Mon Sep 17 00:00:00 2001 From: reaperrr Date: Wed, 1 Apr 2015 20:41:59 +0200 Subject: [PATCH 3/4] Tweak D2k artillery missiles speed and angle. Additionally, remove bogus properties (leftovers from projectile change) --- mods/d2k/weapons.yaml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/mods/d2k/weapons.yaml b/mods/d2k/weapons.yaml index 8abf152f66..9125b2ee7d 100644 --- a/mods/d2k/weapons.yaml +++ b/mods/d2k/weapons.yaml @@ -240,17 +240,14 @@ TowerMissile: Burst: 2 BurstDelay: 15 Projectile: Bullet - Arm: 0 Blockable: false Shadow: yes Inaccuracy: 384 Image: MISSILE2 - RateOfTurn: 10 Trail: large_trail TrailInterval: 1 - Speed: 256 - RangeLimit: 50 - Angle: 110 + Speed: 298 + Angle: 90 Warhead@1Dam: SpreadDamage Spread: 384 Damage: 50 @@ -345,14 +342,12 @@ DevBullet: Report: MISSLE1.WAV ValidTargets: Ground Projectile: Bullet - Speed: 358 - Arm: 5 + Speed: 320 Blockable: false Shadow: yes Inaccuracy: 1c416 - Angle: 110 + Angle: 90 Image: MISSILE2 - RateOfTurn: 5 Trail: large_trail TrailInterval: 1 Warhead@1Dam: SpreadDamage @@ -378,10 +373,10 @@ NerveGasMissile: Burst: 1 Report: MISSLE1.WAV Projectile: Bullet - Speed: 448 + Speed: 384 Blockable: false Shadow: yes - Angle: 110 + Angle: 90 Inaccuracy: 1c96 Image: MISSILE Trail: deviator_trail From 40d73db9fd3cffc04c5d28311dca31c01e1de3b7 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Wed, 1 Apr 2015 21:48:35 +0200 Subject: [PATCH 4/4] Added BlendModes to TS EMP explosion and Ion Cannon explosion --- mods/ts/sequences/misc.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ts/sequences/misc.yaml b/mods/ts/sequences/misc.yaml index fad83cdc02..a38395ccd2 100644 --- a/mods/ts/sequences/misc.yaml +++ b/mods/ts/sequences/misc.yaml @@ -106,8 +106,11 @@ explosion: Length: * building: twlt070 ionring: ring1 + BlendMode: SoftAdditive + Tick: 120 pulse_explosion: pulsefx2 - BlendMode: Additive + BlendMode: SoftAdditive + Tick: 80 small_watersplash: h2o_exp2 large_watersplash: h2o_exp1 water_piff: w_piff