diff --git a/ACViewer/Content/texture.fx b/ACViewer/Content/texture.fx index 40f3787..f9dde6f 100644 --- a/ACViewer/Content/texture.fx +++ b/ACViewer/Content/texture.fx @@ -794,22 +794,8 @@ float4 ParticleInstancePS(ParticleVertexShaderOutput input) : COLOR color.a *= input.OpacityActive.x; - // only output completely opaque pixels - // also discard inactive particles - clip(color.a < 1.0f || input.OpacityActive.y == 0 ? -1 : 1); - - return color; -} - -float4 ParticleInstanceTransPS(ParticleVertexShaderOutput input) : COLOR -{ - float4 color = xTextures.Sample(TextureSampler, input.TextureCoordIdx); - - color.a *= input.OpacityActive.x; - - // only output semi-transparent pixels - // also discard inactive particles - clip(color.a < 1.0f && input.OpacityActive.y > 0 ? 1 : -1); + // discard inactive particles + clip(input.OpacityActive.y == 0 ? -1 : 1); return color; } @@ -817,18 +803,11 @@ float4 ParticleInstanceTransPS(ParticleVertexShaderOutput input) : COLOR technique ParticleInstance { pass Pass0 - { - ZWriteEnable = true; - - VertexShader = compile vs_4_0 ParticleInstanceVS(); - PixelShader = compile ps_4_0 ParticleInstancePS(); - } - pass Pass1 { ZWriteEnable = false; VertexShader = compile vs_4_0 ParticleInstanceVS(); - PixelShader = compile ps_4_0 ParticleInstanceTransPS(); + PixelShader = compile ps_4_0 ParticleInstancePS(); } } diff --git a/ACViewer/Content/texture.mgfxo b/ACViewer/Content/texture.mgfxo index a91f839..8619b1d 100644 Binary files a/ACViewer/Content/texture.mgfxo and b/ACViewer/Content/texture.mgfxo differ diff --git a/ACViewer/GameView.cs b/ACViewer/GameView.cs index c8ee7d8..a67d48f 100644 --- a/ACViewer/GameView.cs +++ b/ACViewer/GameView.cs @@ -142,8 +142,6 @@ protected override void Update(GameTime time) _graphicsDeviceManager.ApplyChanges(); } - PrevKeyboardState = keyboardState; - if (Player != null) Player.Update(time); @@ -165,6 +163,8 @@ protected override void Update(GameTime time) ParticleViewer.Update(time); break; } + + PrevKeyboardState = keyboardState; } private static readonly Color BackgroundColor = new Color(0, 0, 0); diff --git a/ACViewer/Picker.cs b/ACViewer/Picker.cs index b85d61a..e30334d 100644 --- a/ACViewer/Picker.cs +++ b/ACViewer/Picker.cs @@ -370,5 +370,11 @@ public static void DrawHitPoly() GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.LineList, HitVertices, 0, HitVertices.Length, HitIndices, 0, HitIndices.Length / 2); } } + + public static void ClearSelection() + { + HitVertices = null; + HitIndices = null; + } } } diff --git a/ACViewer/WorldViewer.cs b/ACViewer/WorldViewer.cs index 9fef2ce..b70dad9 100644 --- a/ACViewer/WorldViewer.cs +++ b/ACViewer/WorldViewer.cs @@ -208,6 +208,11 @@ public void Update(GameTime time) ShowLocation(); } + if (keyboardState.IsKeyDown(Keys.C) && !PrevKeyboardState.IsKeyDown(Keys.C)) + { + Picker.ClearSelection(); + } + PrevKeyboardState = keyboardState; if (Camera != null)