-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to get access to depth texture #170
Comments
DEPTH_COMPONENT16 is not a depth texture it's a renderbuffer, DEPTH_COMPONENT is a texture, and the valid types are gl.UNSIGNED_SHORT and gl.UNSIGNED_INT And of course you need to check for and enable 'WEBGL_depth_texture' either manually or by calling |
{ format: Constants.DEPTH_COMPONENT, type: Constants.UNSIGNED_SHORT, min: Constants.NEAREST, mag: Constants.NEAREST, wrap: Constants.REPEAT } but in this function, i found no support for DEPTH_COMPONENT |
Color me embarrassed. Apparently I've never made a depth texture with twgl in WebGL1 4.16.0 should work Example: https://twgljs.org/examples/depthtexture-webgl1.html Relevant code
|
Hi, I am working in WebGL1.0 using twgl, recently I want to use this extension;"WEBGL_depth_texture", and create frame buffer using these code:
const attachments = [
{ format: Constants.RGBA, type: Constants.UNSIGNED_BYTE, min: Constants.NEAREST, mag: Constants.NEAREST, wrap: Constants.REPEAT },
{ format: Constants.DEPTH_COMPONENT16, type: Constants.UNSIGNED_SHORT, min: Constants.NEAREST, mag: Constants.NEAREST, wrap: Constants.REPEAT },
];
this.frameBufferInfo = createFramebufferInfo(WebGLContext.getInstance(), attachments, this.width, this.height);
but when i want to use the depth texture as input in anthor shader:
this.frameBufferInfo.attachments[1];
it goes wrong, does any one can tell me where i'm wrong.
The text was updated successfully, but these errors were encountered: