Browse Source

Add Color Field to InfiniteGridComponent

Nikos Kastellanos 8 năm trước cách đây
mục cha
commit
c463c703eb

+ 2 - 0
Shaders/InfiniteGrid/Components/InfiniteGridComponent.cs

@@ -39,6 +39,7 @@ namespace tainicom.Aether.Shaders.Components
         public Matrix Projection;
         public Matrix Projection;
         public Matrix View;
         public Matrix View;
         public Matrix EditMatrix;
         public Matrix EditMatrix;
+        public Color Color = Color.FromNonPremultiplied(255, 163, 0, 255);
 
 
         public InfiniteGridComponent(GraphicsDevice graphicsDevice, ContentManager content)
         public InfiniteGridComponent(GraphicsDevice graphicsDevice, ContentManager content)
         {
         {
@@ -87,6 +88,7 @@ namespace tainicom.Aether.Shaders.Components
             this.GraphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;
             this.GraphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;
 
 
             this._gridEffect.SetDefaultParameters(GraphicsDevice.Viewport, this.Projection, this.View, this.EditMatrix);
             this._gridEffect.SetDefaultParameters(GraphicsDevice.Viewport, this.Projection, this.View, this.EditMatrix);
+            this._gridEffect.DiffuseColor = this.Color.ToVector4();
             
             
             this.GraphicsDevice.SetVertexBuffer(_quadVertexBuffer);
             this.GraphicsDevice.SetVertexBuffer(_quadVertexBuffer);
             this.GraphicsDevice.Indices = _quadIndexBuffer;
             this.GraphicsDevice.Indices = _quadIndexBuffer;

BIN
bin/Release/Windows/Aether.Shaders.InfiniteGrid.dll