Skip to main content

All Questions

Tagged with
0 votes
1 answer
49 views

Default render color vector for fragment shader when using a frame buffer with multiple attachment?

ChatGPT insists that when using a framebuffer and attaching multiple draw buffers, the 0-indexed one will be the one that when you write to in the shader, it will be rendered on the canvas. However I ...
Yuval A.'s user avatar
  • 6,049
0 votes
1 answer
220 views

Stitch images together in WebGL using a framebuffer

This is something of a follow-up to my question Draw textures to canvas async / in sequence deletes old textures, but with a different approach recommended to me by a friend. I am just learning WebGL,...
Seth Lutske's user avatar
  • 10.3k
1 vote
1 answer
50 views

WebGL color conversion during gl.readPixels()

I'm copying a framebuffer to a pixel buffer object. Is there a way during the call of gl.readPixels() to go from RGBA to only RED ? In OpenGL, we can control the glReadPixels() transfer with ...
Sébastien Bémelmans's user avatar
0 votes
0 answers
75 views

WebGL FrameBuffer gets chopped to size of canvas

I have recently tried to learn WebGL so im trying to make 2d game with tiled map, most of code that renders sprites are pasted from a guide that I used to learn some basics. Problem: It only renders ...
LewisSaber's user avatar
0 votes
1 answer
361 views

GL_INVALID_OPERATION: Only array uniforms may have count > 1. Framebuffer in webgl2

I got it spot light. I cut most interest part of code. it almost all there related with framebuffer: App.operation.draws.drawSquareTex = function(object) { var lighting = true; // eslint-disable-...
Nikola Lukic's user avatar
  • 4,197
0 votes
1 answer
771 views

WebGL - Rendering to framebuffer instead of to canvas example extended

The Goal I am trying to extend the WebGL Render to Texture Tutorial to learn WebGL better. So far, I've been able to adjust it so that it renders an image textured-cube instead: Now, what I'm trying ...
Joe's user avatar
  • 1,888
0 votes
1 answer
523 views

WebGL - How do I apply post processing filters to fragment shader output?

My Problem The source of the problem starts with me trying to apply a "glow" or a "halo" effect to whatever is outputted by the fragment shader. What I've Tried The way I found I ...
Joe's user avatar
  • 1,888
0 votes
0 answers
239 views

WebGL (1) rendering to a texture results in: "GL_INVALID_FRAMEBUFFER_OPERATION: Draw framebuffer is incomplete"

Using this helper function we initilize framebuffer and texture: protected _createTextureAndFramebuffer(gl, width, height, data) { const tex = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, ...
daumann's user avatar
  • 37
1 vote
1 answer
421 views

How to figure out the maximum number of framebuffers in WebGL

How do I get the maximum number of possibly allocated framebuffers in WebGL? I assume you use getParameter but I don't know what to pass in it. For the maximum amount of color attchements I know I can ...
yosmo78's user avatar
  • 591
0 votes
1 answer
296 views

Very Weird Situation With Framebuffers And Uniforms (Unexpected Feedback)

I have this situation with framebuffers which I don't understand at all. Have a look at the following: class Shader { constructor(cvs, dim) { cvs.width = dim[0]; cvs.height = dim[1]; ...
fweth's user avatar
  • 765
1 vote
0 answers
159 views

Framebuffer Attachments In WebGL Producing Unexpected Results

I have a problem with framebuffer attachments. Basically, my framebuffers always worked fine, but for my last project I needed to initialize them with some color values. So I created an attachment ...
fweth's user avatar
  • 765
2 votes
1 answer
4k views

WebGL2 : incomplete framebuffer

I'm porting a C++/OpenGL application into WebGL and I'm trying to create and configure a framebuffer. The framebuffer has 3 textures we can write into of types : vec2, vec2, uint. (gl.RG32F, gl.RG32F, ...
bamia's user avatar
  • 353
1 vote
0 answers
148 views

Colors in chrome WebGL are slightly different

I write an application with WebGL. In my fragment shader I set constant color to fragment but in my canvas I actually get a slightly different color. For example I write this code to my fragment ...
Anakin's user avatar
  • 11
2 votes
1 answer
1k views

THREE.js flickering result with Frame Buffer Object

I am working on a scene in THREE.js that uses a Frame Buffer Object. For some reason, I'm seeing a crazy flickering / strobe effect. (The strobe goes away if one comments out the line: mesh.material....
duhaime's user avatar
  • 27k
1 vote
1 answer
630 views

Black screen when rendering to a texture

I'm trying to do the following: Draw the scene in a first pass to a framebuffer I've created. Take the texture that was attached to the created framebuffer and draw that onto a plane so that it can ...
Ronan Quigley's user avatar

15 30 50 per page