Questions tagged [webgl]

WebGL extends the capability of the HTML canvas element to allow it to render accelerated graphics in any compatible web browser. **DO NOT TAG QUESTIONS ABOUT 3D LIBRARIES (like THREE.js) WITH THIS TAG** unless the question is specifically about a WebGL API feature. **DO NOT TAG QUESTION ABOUT UNITY WEBGL WITH THIS TAG!!**

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

Problems by coloring WebGL 3D Object

I'm trying to implement a WebGL app according to the documentation in the Mozilla Docs. My code generates a sphere with is shaped by a scalefactor. The colors are generated according to the ...
0
votes
0answers
33 views

How to simulate click on canvas with webgl by coordinates?

I want to simulate clicks on https://www.thesnidewalk.com/ For example simulate clicks on "walk" button at start menu. I tried this, got coordinates on button and made mouse event and ...
0
votes
0answers
57 views

How to dynamically alternate between a canvas background color and an image in JS?

I have a webGL program where I create lights in my scene stored in an array. When I call render, I'm trying to make the background be black when there are no lights in the array and have an image ...
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 ...
0
votes
1answer
55 views

Emscripten fails to compile shader

I'm using emscripten with C++ 17 and WebGL 1.0 to try to draw some basic things in OpenGL. But I can't seem to go past shader compilation. I tried many different types of shaders to eliminate the ...
1
vote
1answer
70 views

How can I alternate between a background color and a background image on canvas? [closed]

I have this program where I can add lights to my scene (stored in an array lights). When I first start the program, I want everything to be black since I start with my array empty. But when there is a ...
0
votes
1answer
55 views

I can't get Three.js to render a scene from an imported OBJ file

I'm not able to get my Three.js scene to display on HTML canvas. I'm importing an OBJ file which is importing correctly. It shows all details, such as Meshes, materials, etc. correctly. Here is my ...
1
vote
1answer
40 views

Problem with webGL uniforms for particle emitter : "uniform1f: location not for current program"

I have created a particle emitter class with WebGL/JS and it works fine with one instanciation. The problem is when I try to create 2 instances of this object. I get an error message from the GPU : ...
0
votes
1answer
44 views

webgL - apply wind effect on cloth simulation

I need to implement an easy effect of the wind force in a simulation of a cloth. My cloth is made by 10x10 vertices (100 indices given in the cloth_vertices array) connected using springs. The springs ...
-1
votes
0answers
21 views

Unity WebGL hosted in .NET Core not connecting to Redis

I have a .net core 6 (but I think that is the same issue for the 5) solution which has a View that loads the Unity build WebGL. In the Editor Play Mode, Unity works fine and connects to the Redis ...
1
vote
0answers
51 views

Unity WebGL doesn't properly unload and load Addressable scenes

I am trying to unload a previously added scene and then additively load another scene, in that sequence. I use the following code below to do this. This code works correctly in the editor and on all ...
0
votes
0answers
39 views

How to calculate the interpolation factor considering the frameTime

I would like to know how to calculate the interpolation factor considering the frametime to make the interpolation last for a specific amount os seconds. For example, I have two vectors, I want to ...
2
votes
1answer
49 views

WebGL line drawing issue

I am trying to draw simple shapes using WebGL LINES mode. These are my vertices: <canvas width="200" height="200".../> ... vertices.push( 0.01,0.13, 0.03,0.15, 0....
0
votes
0answers
27 views

What is the limit of 3D objects in threejs?

I am developing an application using threejs. Here my application will load thousands of parts using stlLoader (my user will load stl files to viewer) and only one part will be visible , the last ...
1
vote
1answer
30 views

glsl throws bunch of errors

I am trying to get a square drawn on to a html canvas using GLSL and I am actually having a hard time understanding the errors. Here is my code for defining vertex and fragment shaders.Also Don't ...

15 30 50 per page