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
156
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 ...
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". ...
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
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.
...
0
votes
1
answer
71
views
How to minimize cost of drawing 1-2 objects while keeping them bright enough to see?
I have a really simple scene that includes only one or two 3D objects, and the rest of it is UI. My target is WebGL so I am taking every chance to optimize thing as much as possible.
The game objects ...
7
votes
2
answers
2k
views
File saved to IndexedDB lost unless we change scenes
Our game includes an in-game level editor. When the user saves a custom level, the level is serialized and written to a file:
...
0
votes
1
answer
4k
views
Resizing canvas to match screen size in Unity WebGL
I'm learning how to make a browser game with Unity. I have set up the screen display dimensions to 960 x 640 (I read that it's a safe resolution to use. Feel free to correct me). I created a Canvas ...
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 ...
0
votes
1
answer
1k
views
Add a rounded border to a texture with a fragment shader
I am trying to draw a rounded border / outline around a texture. Basically I have two textures doing a transition and the border should look like being part of the textures itself.
I tried different ...
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
134
views
Export Blender models and (procedural) material to Browser?
Given that Verge3d cannot support Volume input, or volumetric shader property in the material output node. Using WebGl 2, and possibly 3.js, is it possible for me to export my blender models and their ...
1
vote
1
answer
2k
views
How to position/transform vertices for 2D UI in shaders?
I am building a 3D engine and have a rendering abstraction that focuses on writing shaders. Most my 3D shaders have gl_Position output like:
...
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
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 ...
4
votes
2
answers
723
views
Why use sprite tile maps on the GPU in WebGL?
I'm trying to figure out the best way of rendering my layered tiled maps with WebGL, and have come across this tutorial several times: https://blog.tojicode.com/2012/07/sprite-tile-maps-on-gpu.html
...
1
vote
1
answer
6k
views
How to copy text from an InputField to the clipboard in WebGL?
I would like to know if there is a solution to copy/paste the text from/to an InputField in a WebGL Unity app.
For security reasons, Unity WebGL doesn't allow text copy and paste in/from browser.
0
votes
1
answer
318
views
Why is this shader using multiple render targets not working?
I have a webgl shader that uses multiple render targets. This one only renders to one texture for now. However, I plan that this shader shall render more. However, as soon as I add layout qualifiers, ...
0
votes
2
answers
860
views
Convert Byte[] to GameObject in webgl
Currently i am using the package to download zip file which contains 3d models in obj format. The download has been completed and converted to byte[], but I am not finding any way to convert the byte ...
2
votes
2
answers
3k
views
Performance of many canvas drawImage calls is very slow
I'm developing a top-down 2D tile-based canvas game. I have a single sprite sheet of all my tiles, and then a JSON tile map array of where they're placed.
Previously I would render all the layers of ...
1
vote
0
answers
59
views
WebGL 2.0: Attaching a shader object to a game object
I'm making a 2d game engine using Java Script and WebGL, both of which I am new to, and was wondering if it was a good idea to use a shader object to initialize the fragment and vertex shader and then ...
0
votes
0
answers
93
views
A blob moving through a pipe that contracts and deforms
I want to have a pipe with elastic walls that one or more blobs can move into which stretch the pipe.
I also want the pipe to be able to contract in diameter and have pressure applied from the outside ...
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 ...
12
votes
3
answers
1k
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 ...