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;*/
        }
        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;
        }
        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);
        }
Exemple #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);
        }
Exemple #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;
 }
Exemple #10
0
 public override void SetTexture(PlanarTerrainBlock block, Texture2D value)
 {
     base.SetTexture(block, value);
     block.NormalTexture = value;
 }
Exemple #11
0
 public override void OnHeightModified(PlanarTerrainBlock block, ref Box2i area)
 {
     base.OnHeightModified(block, ref area);
     RecreateNormalMap(block);
 }
Exemple #12
0
 public override void OnBlockAdded(PlanarTerrainBlock block)
 {
     base.OnBlockAdded(block);
     RecreateNormalMap(block);
     block.NormalTexture = Get(block);
 }
 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);
 }