I have a PNG file with dimensions 128x32128 (equivalent to 251 128x128 layers) and when I try the following:  gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.SRGB8_ALPHA8, 128, 128, 251) gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 128, 128, 251, gl....
is it possible to retrieve pixels value as a float on framebuffer with multiple attachments ? (WebGL 2)  I tried this :  var framebuffer = _gl.createFramebuffer();  _gl.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);  _gl.framebufferTexture2D(_gl.FRAM...
I am trying to get the pixel RGBA data from a canvas for further processing. I think the canvas is actually a Unity game if that makes a difference.  I am trying to do this with the canvas of the game Shakes and Fidget. I use the readPixels method fr...
Question  I'm trying to use Vue JS to display some very simple WebGL. I use a Vue method call inside my canvas element to start the function that renders the WebGL. It all works fine, except that the rendered image flashes on the screen in a flas...
I have the following javascript code:  // convenience function. function v(x, y, z){     var v = vec3.create();     vec3.set(v, x, y, z);     return v; }  window.onload = function() {     gl = get_gl('c', {antialias: true})     var vert_shade...
I need to transform colors in an image obtained from an s3 server which disallows crossOrigin.  This is the functionality I need:    const img = new Image();   img.src = src;   ctx.drawImage(img, 0, 0);   const imageData = ctx.getImageData(0, 0, canv...
Discarding instances in the vertex shader  I am using instanced geom to display content using webGL2. As part of the process each instance has a color component which for some instances may have an alpha value of zero.  Rather than have it passed on...
I am able to write out by hand the full boilerplate to WebGL2 pretty much, and have this much working.    const canvas = document.createElement('canvas') document.body.appendChild(canvas)  const gl = canvas.getContext('webgl2', { anti...
Hi guys I been studying webgl these days.  There are two snippets that accomplish the same thing - draw a square. One is using gl.drawArrays for 6 vertices and one is using gl.drawElements for 4 vertices.  However I noticed that when using gl.drawArr...
i'm trying to paint some models 3D using javascript with webgl2 and i can't undestand the problem i get:  [.WebGL-00000188C244F2D0] GL_INVALID_OPERATION: Insufficient buffer size.   I suposse it is about the buffers but y don't know why,...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.