Esempio n. 1
0
        public void Initialize(VolumeSampler sampler)
        {
            var dim = sampler.resolution;

            _texture = new Texture3D(dim, dim, dim, TextureFormat.RGBAHalf, true);

            _texture.name       = "Distance Field Texture";
            _texture.filterMode = FilterMode.Bilinear;
            _texture.wrapMode   = TextureWrapMode.Clamp;
            _texture.SetPixels(sampler.GenerateBitmap2());
            _texture.Apply();
        }
Esempio n. 2
0
        public void Initialize(VolumeSampler sampler)
        {
            var dim = sampler.resolution;

            dimensions = dim;


            Color[] bmp = new Color[dim * dim * dim];

            _buffer = new ComputeBuffer(dim * dim * dim, sizeof(float) * 4);


            _values = sampler.GenerateBitmap(out bmp);
            _buffer.SetData(values);

            /*_texture = new Texture3D(dim, dim, dim, TextureFormat.RGBAHalf, true);
             *
             * _texture.name = "Distance Field Texture";
             * _texture.filterMode = FilterMode.Bilinear;
             * _texture.wrapMode = TextureWrapMode.Clamp;
             * _texture.SetPixels(bmp);
             * _texture.Apply();*/
        }