The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [webgl]

WebGL is a Javascript API for rendering interactive 3D / 2D graphics on the HTML5 canvas element. It is based on OpenGL ES 2.0.

46 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10
votes
3answers
656 views

How to hide a post-processed mesh outline when/where the mesh is hidden

I'm working on setting up an active outline in my 3d engine, a highlight effect for selected 3d characters or scenery in the screen. After working with the stencil buffer and getting some ...
5
votes
0answers
161 views

Virtual infinite plane in shadow map

I have a WebGL deferred rendering pipeline, where I'm rendering shadow map with VSM technique. The goal is that the scene, or model, is hovering in space, and in addition to casting shadow on itself, ...
4
votes
2answers
925 views

how to use unity3d webgl content in a asp.net mvc view?

I asked this question in stackoverflow but no answers so I think it would fit here better. I have a unity webgl project and an asp.net mvc project. I need to show the webgl content in a view. The ...
4
votes
0answers
984 views

LibGDX's HTML project doesn't show anything in Browser

The question is self explanatory, when I run my demo-html project as a Web Application and I open Chrome with the provided link by eclipse, my browser doesn't show the image it is supposed to show in ...
3
votes
0answers
77 views

GPU Spatial Clustering

I have a around 100k points on the screen (that might update). 2D points. The goal is to cluster them into groups, by a constant distance. Meaning, finding groups of points that the distance between ...
2
votes
0answers
515 views

Webgl: pixel perfect tilemap rendering?

The problem described below is a follow-up of Seamless tilemap rendering (borderless adjacent images). I'm not sure to fully understand the rendering issue I have, so I'll try to describe as much as ...
2
votes
0answers
295 views

Understanding webgl min/mag filter texture artifacts in orthographic projection?

Summary Flickering and shimmering of image plotted on a geometry where the viewport exceeds the size of the screen. I am using an orthographic projection for the camera. In this case, it is tied to ...
2
votes
1answer
62 views

Array of script class references in inspector

I'm trying to remove the Reflection part of one of my scripts so it works in WebGL, however I am having some trouble. Basically I need a way to store references to classes in an Inspector array so ...
1
vote
0answers
31 views

Unity WebGL Responsive content

I was trying to develop a simple drag and drop items for Web. What I was trying to do is to make the UI elements from web view to mobile view when the aspect ratio is changes. I need this web view ...
1
vote
0answers
330 views

Unity WebGL: how to copy to clipboard text from an inputField?

I would like to know if there is a solution to copy/pase text from/to an InputField in a WebGl Unity app. Edit: for security reason, Unity WebGL don't allow text copy and paste in/from browser. ...
1
vote
0answers
41 views

The gist of tweening with WebGL / OpenGL

I am trying to wrap my head around how to take advantage of shaders for things like tweening. For example, there are these simple easing equations, which we can use like this: ...
1
vote
0answers
97 views

How to use model matrix with integer coordinates

I'm trying to generate a real-sized planet with WebGL. After researching, I came to the conclusion that the best way to get around 32-bit float precision issues (since GPUs don't support double ...
1
vote
0answers
310 views

Setting relative anchor point via matrix

The page at https://webglfundamentals.org/webgl/lessons/webgl-2d-matrices.html provides an example for rotating around the center of the image: ...
1
vote
0answers
196 views

Clipping drawn mesh by arbitrary volume

I'm trying to create a visual effect where an arbitrary part of the main scene is either clipped out by or cropped to an arbitrary volume. That is to say, I might want to draw just the area of the ...
1
vote
0answers
247 views

Texture mapping artifacts at triangle edge (for thin triangles?)

I'm working on generating programmatic textures for 3d models and showing them in WebGL using Threejs. To do this I generate a texture image (PNG) that contains per-triangle textures (a rectangle on ...
1
vote
0answers
394 views

How do I correctly unload an additive Scene in WebGL?

I am creating an app in WebGL. I have a loading scene that I am loading additively: SceneManager.LoadScene("Loading Scene", LoadSceneMode.Additive); It loads ...
1
vote
0answers
51 views

Asymetric Perspectiv View

I am building a addon component that will show synthesized 3D view of the world (kind of FLIR camera simulation). The problem I am facing is that currently I am using Symmetric Perspective View with ...
1
vote
0answers
66 views

WebGL frame rate slows down after triggering javascript event

I am using Unity WebGL to host my game on a flask server and trying to throw a warning to the user whenever he tries to navigate away from the tab or mistakenly click browser's back button. Each time ...
1
vote
0answers
1k views

webgl draw call batching and optimizations

I'm working mostly with three.js and webgl, i have some experience with unity. I don't consider three.js a game engine, more of a "rendering library" - something that takes care of the GL ...
1
vote
0answers
861 views

Lighting doesn't work properly in WebGL build only at one place

So I have a 2d game where a player walks around the level (top view) with a flashlight in front of him. Everything works fine in the editor, however whenever I build it for WebGL and test it in my ...
1
vote
0answers
306 views

rotate 3D sphere around itself - webGL

I'm trying to build 3D solar system with webGL. I have all the stars moving in a circle around the sun as sholud be, and I want them also to spin around their own Y axis. How can I add it? I tried : ...
1
vote
0answers
94 views

how to replace vertex buffer in webGL

I want to replace a vertex buffer with another completely different vertex buffer, different size and values, it will not get replaced every frame. ...
1
vote
0answers
312 views

Unity WebGL responsive

I am trying to embed Unity WebGL to a web page. I wonder, is it possible to make this responsive, so it will always fit whatever the screen size? How to do that? Thank you for answering.
1
vote
0answers
214 views

WebGL Primitive Batching unexpected performance

I'm kinda new to WebGL in general, I've started to make some batching experiences on primitives (just drying a bunch of rectangles by using a combination of two triangles repeatedly). I've started by ...
1
vote
0answers
227 views

Using GLFX.js on a full HTML page

I have a friend who is developing a game for HTML, and wants me to implement GLFX into the site page. The problem is GLFX was designed specifically for use with the HTML5 Canvas, which he isn't using, ...
1
vote
0answers
988 views

Unity3D - Upload a image from PC memory to WebGL app

I need user to upload his(her) avatar picture from PC to game How can I create a file dialog and upload a image to WebGL game?
1
vote
0answers
116 views

Cell Based Simulation

I'm working on a cell based simulation in a pixel shader (webgl, shadertoy.com specifically), but am having some challenges trying to make the simulation consistent. Each cell (pixel) has the ...
1
vote
0answers
41 views

How to use quaternion on another referential

I'm new on Three.js and despite a mechanical background, I can't find how quaternion works: it's like it always refers on local part referential and not the global one. I've illustrated it here : ...
1
vote
0answers
50 views

Unstable behavior when applying impulse

I created a video that describes the problem since it very hard to explain it. Basically, using physi.js, I am applying random impulse on the object. In the video, at 0:17 the problem begins when the ...
1
vote
0answers
78 views

WebGL stereo on Linux

Is there any way for us to use frame-sequential stereo with WebGL without having to boot into Windows and use the DirectX hack?
1
vote
0answers
1k views

How can I reduce draw calls when using glBufferSubData and DYNAMIC_DRAW?

At first I had the problem where I had about 150 rectangles rendered every tick. I only used STATIC_DRAW and glBufferData. I ...
1
vote
0answers
789 views

How can I compute spotlight attenuation when I only have a spotlight cutoff angle?

I am trying to compute the spot light attenuation, though I don't have a spotCosCutoff (cosine of the spotlight cutoff angle) predefined variable in the shader so I ...
1
vote
0answers
209 views

Is there an out-of-the-box way to create a custom non-convex polygon in three.js?

Does Three.js offer an out-of-the-box way to create custom non-convex polygon, or do I have to use THREE.Geometry and set faces manually? I'm guessing that ...
0
votes
0answers
7 views

Unexpected scaling of UI elements after build [Unity Web]

I have an unusual scaling of UI Elements after my build in unity for WebGL Game in Unity Engine: Game in Itch.io: Has anyone seen this kind of behaviour? any suggestions on what I should look into? ...
0
votes
0answers
36 views

Logic behind a cubic reflection

I'm creating a cube in WebGL made of mirros that have to reflect the object inside of it. At the moment I'm stuck because I don't understand the correct logic to implement to achieve the result. I ...
0
votes
0answers
10 views

Why Post-Processing v1 not works in WebGL build?

In my WebGL browser app, i've tried to add Post Processing (first version) stack. I'm using Unity 2018.4.6f1 (i started 1 years ago to develop this app). I've added Post Processing Behaviour to my ...
0
votes
1answer
101 views

Unity WebGL Build: Why it shows only Empty Folder?

i'm trying to built my game, made in Unity 2018.3, and i'm trying to built it in WebGL, but the problem is this: built was succeeded, but the Folder is still Empty, and here is the problem occured: ...
0
votes
0answers
72 views

Input.GetAxisRaw not returning zero after releasing the key

In my WebGL Project here is the way for camera navigation (Movement/Rotation) on Update event: ...
0
votes
1answer
35 views

View Space From gl_FragCoord

Trying to get the example code for CalcEyeFromWindow() (first one on the page) to work in WebGL, but having no luck. Paired down the code to the following with some explicit values just in case ...
0
votes
0answers
20 views

How can I get Instagram photos from a WebGl unity application?

I need to get Instagram photos, using Instagram API, from a WebGl application. So instead of going via an intermediate web server: Instagram -> my webserver -> webGl app I'd like to instead get the ...
0
votes
0answers
34 views

Do I need a server if I only want to upload data to a DB?

I'm currently creating a game where people get some kind of reports for their game performance on a website. Let's say, you log-in, play the game, the system gathers your performance data and this is ...
0
votes
0answers
24 views

How to align a particle billboard to the floor of the world

I'm using https://github.com/squarefeet/ShaderParticleEngine and THREE.js to manage particles in my scene. I have a special case where some particle emitters need their particles to align to the ...
0
votes
0answers
313 views

Unity build error: “Could not find file…build.asm.js ”

I made a WebGL game and the first few times it built well, then I continued working on it a bit and when I build it it gives me an error (and does not generate the build files), error: ...
0
votes
0answers
476 views

real time lights and high quality shadows in webgl build

I have a game in which there are a lot of objects constantly moving around and a lot of real time lights with their setting set to highest, I'm building my game as webgl and this is costing me a lot ...
0
votes
0answers
73 views

Phaserjs, filters, save to image cache

I've tried to apply a Pixi filter to a image and save it to cache but the image doesn't get saved with the filter. ...
-4
votes
1answer
2k views

How can I create a WebGL camera based on quaternions?

I am trying to create a WebGL camera based on quaternions. I looked at many tutorials, and none is as simple as it could be or it was not working. How can I create such a camera?