Esempio n. 1
0
        protected OptixBuffer CreateOutputBuffer(Format format, int width, int height)
        {
            if (UsePBO)
            {
                //Allocate first the memory for the gl buffer, then attach it to OptiX.
                uint pbo = CreatePBO(format);

                OGLBufferDesc glDesc = new OGLBufferDesc()
                {
                    Width    = (uint)width,
                    Height   = (uint)height,
                    Format   = format,
                    Type     = BufferType.Output,
                    Resource = pbo
                };
                return(new OGLBuffer(OptixContext, glDesc));
            }
            else
            {
                BufferDesc desc = new BufferDesc()
                {
                    Width  = (uint)width,
                    Height = (uint)height,
                    Format = format,
                    Type   = BufferType.Output
                };
                return(new OptixBuffer(OptixContext, desc));
            }
        }
Esempio n. 2
0
        protected OptixDotNet.Buffer CreateOutputBuffer(Format format, int width, int height)
        {
            if (UsePBO)
            {
                //Allocate first the memory for the gl buffer, then attach it to OptiX.
                uint pbo = CreatePBO(format);

                OGLBufferDesc glDesc = new OGLBufferDesc()
                {
                    Width = (uint)width,
                    Height = (uint)height,
                    Format = format,
                    Type = BufferType.Output,
                    Resource = pbo
                };
                return new OGLBuffer(Context, glDesc);
            }
            else
            {
                BufferDesc desc = new BufferDesc()
                {
                    Width = (uint)width,
                    Height = (uint)height,
                    Format = format,
                    Type = BufferType.Output
                };
                return new OptixDotNet.Buffer(Context, desc);
            }
        }
Esempio n. 3
0
        protected void CreateOutputBuffer(Format format) {
            if (UsePBO) {
                //Allocate first the memory for the gl buffer, then attach it to OptiX.
                uint pbo = CreatePBO(format);

                OGLBufferDesc glDesc = new OGLBufferDesc() {
                    Width = (uint)Width,
                    Height = (uint)Height,
                    Format = format,
                    Type = BufferType.Output,
                    Resource = pbo
                };
                OutputBuffer = new OGLBuffer(Context,  glDesc);
            }
            else {
                BufferDesc desc = new BufferDesc() {
                    Width = (uint)Width,
                    Height = (uint)Height,
                    Format = format,
                    Type = BufferType.Output
                };
                OutputBuffer = EngineContext.Instance.ResourceManager.CreateBuffer(Context, desc);
            }
        }