public virtual void SetTexture(PlanarTerrainBlock block, Texture2D value)
        {
            //Texture2D texture;

            throw new NotImplementedException();
            /*Textures.TryGetValue(block.BlockIndex, out texture);
            Terrain.RenderTargetCache.ReturnToPool(texture);
            Textures[block.BlockIndex] = value;*/
        }
Пример #2
0
        public virtual void SetTexture(PlanarTerrainBlock block, Texture2D value)
        {
            //Texture2D texture;

            throw new NotImplementedException();

            /*Textures.TryGetValue(block.BlockIndex, out texture);
             * Terrain.RenderTargetCache.ReturnToPool(texture);
             * Textures[block.BlockIndex] = value;*/
        }
        void RecreateNormalMap(PlanarTerrainBlock block)
        {
            var effect = Terrain.Program; // NormalEffect
            effect.Uniforms["heightTexture"].Set(block.HeightTexture);
            Terrain.FrameBuffer.Colors[0].Attach(Get(block));
            Device.FrameBuffer = Terrain.FrameBuffer;
            Terrain.DrawUnitRectangle("normal");
            Device.FrameBuffer = null;

            effect.Uniforms["heightTexture"].Set((Texture2D)null);
        }
        public Texture2D Get(PlanarTerrainBlock block)
        {
            Texture2D pair = null;

            if (!Textures.TryGetValue(block.BlockIndex, out pair) || pair == null)
            {
                pair = new Texture2D(Format, Terrain.BlockSize, Terrain.BlockSize);
                Textures[block.BlockIndex] = pair;
            }

            return pair;
        }
Пример #5
0
        public Texture2D Get(PlanarTerrainBlock block)
        {
            Texture2D pair = null;

            if (!Textures.TryGetValue(block.BlockIndex, out pair) || pair == null)
            {
                pair = new Texture2D(Format, Terrain.BlockSize, Terrain.BlockSize);
                Textures[block.BlockIndex] = pair;
            }

            return(pair);
        }
Пример #6
0
        void RecreateNormalMap(PlanarTerrainBlock block)
        {
            var effect = Terrain.Program;             // NormalEffect

            effect.Uniforms["heightTexture"].Set(block.HeightTexture);
            Terrain.FrameBuffer.Colors[0].Attach(Get(block));
            Device.FrameBuffer = Terrain.FrameBuffer;
            Terrain.DrawUnitRectangle("normal");
            Device.FrameBuffer = null;

            effect.Uniforms["heightTexture"].Set((Texture2D)null);
        }
Пример #7
0
 public override void OnDrawing(PlanarTerrainBlock block, ref Matrix4d world)
 {
     base.OnDrawing(block, ref world);
     Frustum.Transform = world * view * projection;
 }
 public override void OnBlockAdded(PlanarTerrainBlock block)
 {
     base.OnBlockAdded(block);
     block.ColorTexture = Get(block);
 }
 public override void OnDrawing(PlanarTerrainBlock block, ref Matrix4d world)
 {
     base.OnDrawing(block, ref world);
     Frustum.Transform = world * view * projection;
 }
Пример #10
0
 public override void SetTexture(PlanarTerrainBlock block, Texture2D value)
 {
     base.SetTexture(block, value);
     block.NormalTexture = value;
 }
Пример #11
0
 public override void OnHeightModified(PlanarTerrainBlock block, ref Box2i area)
 {
     base.OnHeightModified(block, ref area);
     RecreateNormalMap(block);
 }
Пример #12
0
 public override void OnBlockAdded(PlanarTerrainBlock block)
 {
     base.OnBlockAdded(block);
     RecreateNormalMap(block);
     block.NormalTexture = Get(block);
 }
Пример #13
0
 public override void OnBlockAdded(PlanarTerrainBlock block)
 {
     base.OnBlockAdded(block);
     block.HeightTexture = Get(block);
 }
 public override void SetTexture(PlanarTerrainBlock block, Texture2D value)
 {
     base.SetTexture(block, value);
     block.HeightTexture = value;
 }
 public override void OnHeightModified(PlanarTerrainBlock block, ref Box2i area)
 {
     base.OnHeightModified(block, ref area);
     RecreateNormalMap(block);
 }
 public override void OnBlockAdded(PlanarTerrainBlock block)
 {
     base.OnBlockAdded(block);
     RecreateNormalMap(block);
     block.NormalTexture = Get(block);
 }