webgl-extensions

Determine internal format of given astc compressed image through its header?

ぃ、小莉子 提交于 2019-12-24 03:19:36
问题 I am writing a EbGL based HTML application that uses ASTC (Adaptive Scalable Texture Compression) compressed textures to be loaded on my triangle. I would like to know that does there exists a way to know whether the internal format of the compressed ASTC image(that in my case might be located on a remote web server) is "linear" or "srgb encoded", by parsing the ASTC header. I can then use that internalFormat information obtained to pass my ASTC texture to glCompressedTexImage2D() . In other

Is it possible to run #version 120 shaders with WebGL

孤街浪徒 提交于 2019-12-23 09:04:56
问题 I have a number of GLSL fragment shaders for which I can pretty much guarantee that they conform to #version 120 They use standard, non-ES conformant values and they do not have any ES-specific pragmas. I really want to make a web previewer for them using WebGL. The previewer won't be used on mobile. Is this feasible? Is the feature set exposed to GLSL shaders in WebGL restricted compared to that GLSL version? Are there precision differences? I've already tried playing with THREE.js but that

OES_texture_float extension use

你说的曾经没有我的故事 提交于 2019-12-11 21:15:34
问题 How to use the OES_texture_float extension? I do not understand that it is necessary to specify the arguments the function texImage2D. var fb=gl.createFramebuffer(); gl.bindFramebuffer(gl.FRAMEBUFFER, fb); var rb=gl.createRenderbuffer(); gl.bindRenderbuffer(gl.RENDERBUFFER, rb); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16,size[0],size[1]); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER, rb); var texture=gl.createTexture(); gl.bindTexture(gl

WebGL: Declining support for OES_texture_float on Android

纵然是瞬间 提交于 2019-12-10 17:29:59
问题 Does anybody know what the deal is with declining support for the WebGL extension OES_texture_float on Android over the years? https://webglstats.com/webgl/extension/OES_texture_float?platforms=000000000010000400 Is this a data collection error of some sort, or is the support really declining? If you take Android out of the filter then `OES_texture_float is supported on basically 100% of the other mainstream mobile and desktop platforms: https://webglstats.com/webgl/extension/OES_texture

mat3 attribute in WebGL

时光毁灭记忆、已成空白 提交于 2019-12-08 02:09:22
问题 I'm attempting to use the ANGLE_instanced_arrays extension in WebGL to render multiple instances of an object with different mat3 transformation matrices. This is the code related to the buffer for my matrices: //setup this.shaderProgram.transformAttribute = gl.getAttribLocation(this.shaderProgram, "transform"); ext.vertexAttribDivisorANGLE(this.shaderProgram.transformAttribute, 1); this.transformBuffer = gl.createBuffer(); //each render gl.enableVertexAttribArray(this.shaderProgram

mat3 attribute in WebGL

拜拜、爱过 提交于 2019-12-06 13:40:58
I'm attempting to use the ANGLE_instanced_arrays extension in WebGL to render multiple instances of an object with different mat3 transformation matrices. This is the code related to the buffer for my matrices: //setup this.shaderProgram.transformAttribute = gl.getAttribLocation(this.shaderProgram, "transform"); ext.vertexAttribDivisorANGLE(this.shaderProgram.transformAttribute, 1); this.transformBuffer = gl.createBuffer(); //each render gl.enableVertexAttribArray(this.shaderProgram.transformAttribute); gl.bindBuffer(gl.ARRAY_BUFFER, this.transformBuffer); gl.bufferData(gl.ARRAY_BUFFER, new

The complete list of promoted extensions in WebGL2

一个人想着一个人 提交于 2019-12-04 02:31:11
问题 I got a chance to update our renderer we use to WebGL2. To make the renderer as backward compatible as possible we keep tracking of loaded extensions( as we did before the upgrade ) and emulate extensions even if such extension was promoted. The renderer does a few relevant things with extensions. From outside, everything is quite transparent. To make it work smoothly, I need the complete list of promoted extensions. Have found few blogs, but those lists are not complete. Other lists which I

How do you convert to half floats in JavaScript?

不问归期 提交于 2019-12-03 17:20:29
问题 I want to be able to use the OES_texture_half_float extension in WebGL and provide my own data but there's no Float16Array in JavaScript. So how do I generate half float data? 回答1: I adapted these 2 functions to JavaScript. They seem to work From here var toHalf = (function() { var floatView = new Float32Array(1); var int32View = new Int32Array(floatView.buffer); /* This method is faster than the OpenEXR implementation (very often * used, eg. in Ogre), with the additional benefit of rounding,

The complete list of promoted extensions in WebGL2

拈花ヽ惹草 提交于 2019-12-01 15:01:31
I got a chance to update our renderer we use to WebGL2. To make the renderer as backward compatible as possible we keep tracking of loaded extensions( as we did before the upgrade ) and emulate extensions even if such extension was promoted. The renderer does a few relevant things with extensions. From outside, everything is quite transparent. To make it work smoothly, I need the complete list of promoted extensions. Have found few blogs, but those lists are not complete. Other lists which I have found on GitHub look wrong because they have redundant extensions which were in fact not promoted