(gl, internalFormat, format, type)
| 189 | } |
| 190 | |
| 191 | function supportRenderTextureFormat (gl, internalFormat, format, type) { |
| 192 | let texture = gl.createTexture(); |
| 193 | gl.bindTexture(gl.TEXTURE_2D, texture); |
| 194 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); |
| 195 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); |
| 196 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); |
| 197 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); |
| 198 | gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 4, 4, 0, format, type, null); |
| 199 | |
| 200 | let fbo = gl.createFramebuffer(); |
| 201 | gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); |
| 202 | gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); |
| 203 | |
| 204 | let status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); |
| 205 | return status == gl.FRAMEBUFFER_COMPLETE; |
| 206 | } |
| 207 | |
| 208 | function startGUI () { |
| 209 | var gui = new dat.GUI({ width: 300 }); |
no outgoing calls
no test coverage detected