Skip to content

Render depth buffer to texture #188

@Arsakes

Description

@Arsakes

Let's consider customRenderTree example provided on wiki.
I wanted to modify it and allow rendering depth buffer into texture aswell.

When I'm setting deprthAsRenderbuffer to false, backbuffer.depthTarget.isTexture is false, and XML throws an error when trying to use this buffer as a texture (I've checked in XML3D code that with this option set to false such texture is supposed to be created.)

Code is following

var backBuffer = this.renderInterface.createRenderTarget({
                width: context.canvasTarget.width,
                height: context.canvasTarget.height,
                colorFormat: context.gl.RGBA,
                depthFormat: context.gl.DEPTH_COMPONENT_16,
                depthAsRenderbuffer: false,
                stencilFormat: null
            });
console.log(backBuffer.depthTarget.isTexture) // FALSE should be TRUE according to xml3d code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions