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.
289 questions
1
vote
0
answers
43
views
Camera is skipping frames after turning a little bit
I'm observing that when I move the camera a little bit it works normally, but if I move more then I'll skip chunks of the screen.
I enabled "press CTRL twice to show cursor" with Powertoys ...
0
votes
0
answers
154
views
Browser memory increasing the longer Unity WebGL build runs
I have an app in Unity WebGL that should run for a long time (a few days) without stopping. One issue I notice is that, the longer the app runs the browser memory usage gets bigger. Is this related to ...
1
vote
0
answers
213
views
Minimal Content-Security-Policy (CSP) for WebGL Builds
I have a Webgl build created in Unity 2020.3.22f1.
The Content Policy looks like this (set to report-only for debugging):
Code (htaccess):
...
0
votes
1
answer
292
views
The WebGL version of my game does not load the next scene when using an async action
I've just created a WebGL build for my puzzle game in Unity. While the Windows version worked just fine, I encountered a bug on the web: it cannot load the next level when you collide with the goal.
...
4
votes
1
answer
808
views
What causes some web game engines work in "slow mo" mode instead of reducing FPS but continuing to show the true time/tick state of things?
I used game engines that are capable of cross-platform export: Cocos Creator, Godot, Unity, others.
Some game engines have this thing, called "physics update" or "fixed update". ...
0
votes
1
answer
251
views
Unity Mirror Networking Audio Behaves Differently on Host and WebGL Client
I am creating a system in Unity using Mirror Networking which will only require one host/server and one client. It is a WebGL build so the client will connect on a browser. I want to send commands ...
1
vote
1
answer
115
views
Character walks too fast when browser's hardware acceleration is turned off
I have posted a project on itch.io (here). My character walks with the speed I intended when Chrome's hardware acceleration is turned on but walks much faster when it is turned off. First, my friend ...
0
votes
1
answer
398
views
WebGL FPS is sometimes higher than max. FPS setting - why?
In lots of WebGL online games (all games I tested were made with Unity), my FPS is sometimes higher than the max, FPS setting of my PC (75), but why?
0
votes
1
answer
81
views
Semi transparent objects show fuzzy halos when in shadow
I'm having some issues when drawing a semi transparent object after an opaque object, and the object is in the shadows.
On the left, the torch is rendered just fine, I can see a nice blend of the ...
0
votes
1
answer
106
views
BasisParser returns undefined from loading KTX2 file with custom extension
I get 'undefined' from the BasisParser that I use from Pixi itself, when loading a KTX2 file with a custom extension (through Assets.load):
...
0
votes
1
answer
125
views
Align two meshes given 2 faces
I have two meshes (A and B) and I know that a triangle in A has the same size and same angles as a triangle in B.
For simplicity, suppose A is an octahedron and B is a tetrahedron. And suppose the ...
0
votes
1
answer
1k
views
How to create global function for all .JSLIB files?
I can't understand how to work with .jslib files. I don't understand the syntax of this type of file. Also I couldn't find any easy explanation of it
The problem ...
0
votes
0
answers
1k
views
Client says they want Unreal scene viewable in a web browser 😳 last minute
I have a job that I did for a client and the client wants the project to be viewable in a web browser. I looked into it and all I found was people telling me that it's impossible, but this is a low ...
0
votes
0
answers
130
views
How to listen for a TCP message?
I want to create a Unity WebGL application, that will run in a browser.
I want to allow this application to "listen" for messages, so it needs to be a server.
What could be the developing ...
13
votes
1
answer
4k
views
How to do color post processing in WebGL, when you can not read the color of the current pixel?
In a WebGL 2 GLSL fragment shader, one can not access the pre-existing color value of the current pixel, i.e. the color that is already there in the framebuffer before the pixel that is currently ...
0
votes
0
answers
78
views
WebGL fragment shaders for SNES S-PPU?
I’m not very experienced with WebGL and want to ask if this project is potentially feasible and also for a few hints about what direction I may want to take.
I’d like to implement all of the logic ...
0
votes
0
answers
944
views
How to decompose a GLSL mat4 to original RTS values within vertex shader?
I need to get the rotation differences between the model and the camera.
convert the values to radians/degrees and pass it to the fragment shader.
for that I need to decompose and the Model rotation ...
1
vote
0
answers
716
views
Cursor trail with fragment shader
I wish to draw a simple mouse trail using fragment shaders, similar in appearance to drawing the following in processing (omitting the step of clearing the canvas). I cannot wrap my head around the ...
2
votes
0
answers
22
views
UV interpolation gets distorted on a trapezoid [duplicate]
I'm experiencing an interesting distortion in the UV mapping of a trapezoid. When I map a square plane and tilt it backwards, the perspective-correct interpolation gives it the expected pinching at ...
10
votes
3
answers
5k
views
Performance degrading when resolution increases for a 4k screen
I am new to Unity.
I have a problem where my game has good performance on my non-4k screen.
Bur when I play it on my 4k screen, the performance gets really bad.
It looks like the resolution is ...
0
votes
1
answer
123
views
gl.drawArrays() not rendering whole mesh
I have a mesh that is generated using the marching cubes algorithm that is drawn using gl.drawArrays(), however the whole mesh isn't rendered, only part of it. I checked if the count I was specifiying ...
0
votes
0
answers
30
views
handling obj file without normal [duplicate]
I am trying to build an obj file loader and I have written code to read an obj file with face f with v/vt/vn - vertex, texture coordinate, and normal.
While going through the obj file, there are so ...
1
vote
1
answer
1k
views
File writing or scriptable object editing in unity webgl
I am using a scriptable object for saving data. I know that scriptable objects are unchangeable means we can't change and save data after runtime but is there any workaround available to update it? Or ...
0
votes
1
answer
3k
views
How to play sound in WebGL build in Unity?
I have a project that works fine when I build for windows, but doesn't work when I switch platform to WebGL. The [SerializeField] AudioClip variables in the ...
0
votes
0
answers
921
views
For drawing many layered 2D tiles, should one use the painter's algorithm, or Z-buffering?
Sorry if this question doesn't make sense, I'm still very new to WebGL / OpenGL.
Basically, I'm trying to draw a tilemap similar to the one in Stardew Valley. Here's a screenshot from that game: https:...