You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you can only render to one face of a cube map at a time so your target should be one of the faces which means you need to create the cubemap separately. Example
const width = 2;
const height = 2;
// make an empty cubemap
const tex = twgl.createTexture(gl, {
target: gl.TEXTURE_CUBE_MAP,
width,
height,
minMag: gl.LINEAR,
});
const faces = [
gl.TEXTURE_CUBE_MAP_POSITIVE_X,
gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
gl.TEXTURE_CUBE_MAP_POSITIVE_Y,
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
gl.TEXTURE_CUBE_MAP_POSITIVE_Z,
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,
];
// make a framebuffer info for each face
const fbis = faces.map(target => twgl.createFramebufferInfo(gl, [{ attachment: tex, target }], width, height));
Hi, I want to render to a cubemap, I use this attachments to create cube rendertarget but seems not working.
attachments = [ { internalFormat: Constants.RGBA, format: Constants.RGBA, type: type, min: this.minFilter, mag: this.maxFilter, wrap: Constants.CLAMP_TO_EDGE, target: Constants.TEXTURE_CUBE_MAP } ];
The text was updated successfully, but these errors were encountered: