Esempio n. 1
0
        protected override void DoInitialize()
        {
            base.DoInitialize();

            this.vVertexBuffer = this.model.GetVertexAttributeBuffer(SlicesModel.position);

            Texture volume = Engine256Loader.Load();

            volume.TextureUnitIndex = 0;
            Texture lut = TransferFunctionLoader.Load();

            lut.TextureUnitIndex = 1;

            {
                RenderUnit    unit    = this.RenderUnits[(int)RenderMode.Default];
                ShaderProgram program = unit.Program;
                program.SetUniform("volume", volume);
            }
            {
                RenderUnit    unit    = this.RenderUnits[(int)RenderMode.Classification];
                ShaderProgram program = unit.Program;
                program.SetUniform("volume", volume);
                program.SetUniform("lut", lut);
            }
        }
Esempio n. 2
0
        protected override void DoInitialize()
        {
            base.DoInitialize();

            Texture volume = Engine256Loader.Load();

            volume.TextureUnitIndex = 0;

            for (int i = 0; i < this.RenderUnits.Count; i++)
            {
                RenderUnit    unit    = this.RenderUnits[i];
                ShaderProgram program = unit.Program;
                program.SetUniform("volume", volume);
                program.SetUniform("step_size", new vec3(1.0f / Engine256Loader.XDIM, 1.0f / Engine256Loader.YDIM, 1.0f / Engine256Loader.ZDIM));
            }
        }