Esempio n. 1
0
        private void BeginUpdate()
        {
            if (_slice == null)
            {
                _slice = new float[_d];
            }

            GL.GetInteger(GetPName.TextureBinding2D, out _lastTex);
            Heightmap.Activate();
        }
Esempio n. 2
0
        private void UpdateRows(int startY, int size)
        {
            Heightmap.Activate();
            for (var i2 = 0; i2 < size; i2++) // foreach row to be updated
            {
                var i  = startY + i2;
                var yt = i & _n; // row in texture

                for (var j = 0; j < _d; j++)
                {
                    _slice[j] = GeneratePixelAt2(j, yt);
                }

                GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, yt, _d, 1, PixelFormat.Luminance,
                                 PixelType.Float, _slice);
            }
        }
Esempio n. 3
0
        private void UpdateColumns(int startX, int size)
        {
            Heightmap.Activate();
            for (var i2 = 0; i2 < size; i2++)
            {
                var i  = startX + i2;
                var xt = i & _n;

                for (var j = 0; j < _d; j++)
                {
                    _slice[j] = GeneratePixelAt2(xt, j);
                }


                GL.TexSubImage2D(TextureTarget.Texture2D, 0, xt, 0, 1, _d, PixelFormat.Luminance,
                                 PixelType.Float, _slice);
            }
        }