WebGL

Opengl and Webgl: sampling from a texture attached to current framebuffer

巧了我就是萌 提交于 2020-06-23 12:37:05
问题 I have a framebuffer with two textures t0 and t1 attached. On the first pass I render to both of them with multiple fragment shader output. Before the second pass I do thew following: Turn on a shader with one output only Bind t1 to a texture unit call glDrawBuffers to disable writing to t1 's attachment Note that t1 is used for sampling, but it's still bound to current framebuffer. As I understand, there are no loopbacks in such configuration. Is it legal in both OpenGL and WebGL? I made an

Allowing more WebGL contexts

本小妞迷上赌 提交于 2020-05-29 11:49:41
问题 I'm currently working on a website with a list of items. Each item has a thumbnail, and I'm adding a shader effect on all of them using PixiJS . The problem is that there's more than 16 items on the list, so I'm getting the following error : WARNING: Too many active WebGL contexts. Oldest context will be lost. Is there a way to increase this limit ? I can't make the whole page on WebGL, and the usage is so limited (no interaction, lite effect) that I think more WebGL contexts will not make

Allowing more WebGL contexts

我是研究僧i 提交于 2020-05-29 11:48:08
问题 I'm currently working on a website with a list of items. Each item has a thumbnail, and I'm adding a shader effect on all of them using PixiJS . The problem is that there's more than 16 items on the list, so I'm getting the following error : WARNING: Too many active WebGL contexts. Oldest context will be lost. Is there a way to increase this limit ? I can't make the whole page on WebGL, and the usage is so limited (no interaction, lite effect) that I think more WebGL contexts will not make

Encode floating point data in a RGBA texture

情到浓时终转凉″ 提交于 2020-05-28 00:59:40
问题 I wrote some WebGL code that is based on floating point textures. But while testing it on a few more devices I found that support for the OES_texture_float extension isn't as widespread as I had thought. So I'm looking for a fallback. I have currently a luminance floating point texture with values between -1.0 and 1.0. I'd like to encode this data in a texture format that is available in WebGL without any extensions, so probably a simple RGBA unsigned byte texture. I'm a bit worried about the

Encode floating point data in a RGBA texture

左心房为你撑大大i 提交于 2020-05-28 00:58:17
问题 I wrote some WebGL code that is based on floating point textures. But while testing it on a few more devices I found that support for the OES_texture_float extension isn't as widespread as I had thought. So I'm looking for a fallback. I have currently a luminance floating point texture with values between -1.0 and 1.0. I'd like to encode this data in a texture format that is available in WebGL without any extensions, so probably a simple RGBA unsigned byte texture. I'm a bit worried about the

Encode floating point data in a RGBA texture

限于喜欢 提交于 2020-05-28 00:56:51
问题 I wrote some WebGL code that is based on floating point textures. But while testing it on a few more devices I found that support for the OES_texture_float extension isn't as widespread as I had thought. So I'm looking for a fallback. I have currently a luminance floating point texture with values between -1.0 and 1.0. I'd like to encode this data in a texture format that is available in WebGL without any extensions, so probably a simple RGBA unsigned byte texture. I'm a bit worried about the

Draw multiple models in WebGL

 ̄綄美尐妖づ 提交于 2020-05-17 04:40:21
问题 Problem constraints: I am not using three.js or similar, but pure WebGL WebGL 2 is not an option either I have a couple of models loaded stored as Vertices and Normals arrays (coming from an STL reader). So far there is no problem when both models are the same size. Whenever I load 2 different models, an error message is shown in the browser: WebGL: INVALID_OPERATION: drawArrays: attempt to access out of bounds arrays so I suspect I am not manipulating multiple buffers correctly. The models

Draw multiple models in WebGL

a 夏天 提交于 2020-05-17 04:38:23
问题 Problem constraints: I am not using three.js or similar, but pure WebGL WebGL 2 is not an option either I have a couple of models loaded stored as Vertices and Normals arrays (coming from an STL reader). So far there is no problem when both models are the same size. Whenever I load 2 different models, an error message is shown in the browser: WebGL: INVALID_OPERATION: drawArrays: attempt to access out of bounds arrays so I suspect I am not manipulating multiple buffers correctly. The models

Draw multiple models in WebGL

旧时模样 提交于 2020-05-17 04:37:19
问题 Problem constraints: I am not using three.js or similar, but pure WebGL WebGL 2 is not an option either I have a couple of models loaded stored as Vertices and Normals arrays (coming from an STL reader). So far there is no problem when both models are the same size. Whenever I load 2 different models, an error message is shown in the browser: WebGL: INVALID_OPERATION: drawArrays: attempt to access out of bounds arrays so I suspect I am not manipulating multiple buffers correctly. The models

WebGL 2D camera zoom to mouse point

血红的双手。 提交于 2020-05-09 12:07:40
问题 I'm currently building a 2D drawing app in WebGL. I want to implement zoom to point under mouse cursor similar to example in here. But I can't figure out how to apply the solution from that answer in my case. I have done basic zoom by scaling camera matrix. But it zooms to the top-left corner of the canvas, due to that being the origin (0,0) set by the projection (as far as I understand). Basic pan & zoom implemented: My draw function (including matrix computations) looks like this: var