All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

How Do I change the color of webgl points?

This is the code I used to try to change the color of WebGL points: I want to change the color of WebGL points when a user clicks the body element. And FYI the shaders are compiling correctly. The ...
0
votes
0answers
34 views

What's the purpose of `gl.deleteShader` in WebGL?

It's a sensible function in OpenGL ES, where such objects are referenced by unsigned integers. But WebGL is a JavaScript binding and it's by direct object reference: gl.createShader returns a ...
1
vote
1answer
37 views

What is the purpose of calling gl.enableVertexAttribArray(); function in WebGL

In WebGL before we call the drawArrays() function we call this function called enableVertexAttribArray() passing the reference to a variable in my compiled glsl program which stores the vertex ...
-1
votes
0answers
24 views

How to draw unlimited canvas elements in a single page with using WebGL

I'm working on a heatmap calendar, canvas-based component. It takes into account the (practical) maximum canvas size and creates multiple canvas as needed, so that you can let the component display ...
0
votes
0answers
27 views

Three.js flickering only on macbook pro retina screen

I'm running into an issue with flickering when rendering a moving point cloud in Three.js. The issue only appears when the page is loaded on a Macbook Pro Retina screen. Interestingly, if the page is ...
0
votes
0answers
41 views

Is it possible to make a mesh in webgl using squares or boxes instead of triangles?

I want to know if I can make a mesh using other shapes instead of triangles in webgl… I am new to Pure Webgl even though I have been Using BabylonJS for some time now, I wanna learn more about the ...
2
votes
1answer
60 views

Progressively reveal circle in loop

I currently have this: Codepen (embedded snippet below). I would like to be able to change the color progressively after the scanline, something like this: After searching online and trying to find ...
2
votes
0answers
30 views

Is it guaranteed that quads later in the vertex buffer will be drawn on top of previous quads?

Let's say we are drawing a bunch of rectangles in OpenGL. That is, we're filling up a vertex buffer and then drawing them all in a single call call via drawArrays, like this: let count = 3; gl....
0
votes
0answers
112 views

How to draw the scale meter/ ruler for the 3D model in WebGL

I want to draw a fixed horizontal line (or a ruler) that gives info about size/distance or zooming factor like the one in Google Maps (see here). Here is the another example with different zoom levels ...
0
votes
0answers
44 views

WebGLBuffer assigned to attribute used as attribute 'a_position' in current program is too small for draw parameters

I am trying to render a sphere in WebGL. function sphereVertIndices() { let index = 0; for (let i = 0; i <= numbLatitude; i++) { theta = (i * Math.PI) / numbLatitude; let ...
1
vote
0answers
66 views

WebGL2: what is up with max elements indices/vertices?

I'm developing a web component using WebGL2 (and three.js) with OES_element_index_uint enabled. I'm drawing a geometry using indexed vertices and I'm seeing the following anomaly -- look for the ...
0
votes
0answers
41 views

How to pick a 2D object in WebGL using GLSL?

I've been studying WebGL for a while now - I've already asked some questions here - but I'm not really getting the hang of it. One of the things I'm trying now is to pick an object. I've seen numerous ...
0
votes
0answers
104 views

How can I draw triangles using the mouse x and y coordinates to designate the vertices in WebGL?

I'm trying to create triangles based on vertices. My idea is the following: I store the points in an array g_points and whenever there are three new points, it should draw triangles using those points ...
0
votes
0answers
58 views

WebGL rendering order/organization/flow with multiple shaders

I'm struggling to understand some concepts of rendering organization in webgl. I'm working on a 2D game which has 2 types of objects - sprites and polygons. I have different shaders for that, sort my ...
0
votes
1answer
37 views

Mouseclick changes the behavior of WebGL code

I have an array of three set of vertices which I use to draw three points on the screen. I added another vertex to my array of vertices using the push() method of javascript after initially ...

15 30 50 per page
1
2 3 4 5
10