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.

Filter by
Sorted by
Tagged with
0
votes
0answers
29 views

Exporting WebGL For Mobile Browsers

I was asked by a client to create a pretty simple 3D game that will be embedded on a website, a plain landing page that will contain the game and will be played on mobile devices. The game itself has ...
0
votes
1answer
24 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 ...
4
votes
0answers
72 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 ...
0
votes
0answers
16 views

How to share microgame with WebGL Publisher? (Unity)

I did unity lego microgame tutorials and now I want to publish it with WebGL publisher. I created build files but I can't publish. I get this error: I rebuild again to solve this problem. (3 more ...
0
votes
1answer
101 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
0answers
20 views

WebGL transparent gradient mask at edge

I need to make a feature in WebGL, where I have horizontal list of meshes (example 20) and I want to show only 3 and 2 at edge are fade in/fade out. And it slowly animates from one side no another (...
0
votes
1answer
26 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
0answers
46 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:...
0
votes
0answers
27 views

URP water showing Differently in on Runtime

I am using this water for my URP webgl build but the problem is it is showing differently on the editor. When I run the game then it showing correctly and when I build and run it in the browser then ...
0
votes
2answers
59 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 ...
0
votes
1answer
22 views

What is the best rate at which to send updates to clients for a first person shooter NodeJS WebSocket server?

I developed a multiplayer FPS using WebGL, Nodejs and WebSockets. So far it is running great. I am currently using setInterval(sendPlayerPositions, 16); to send updates to WebGL clients. Ideally I ...
1
vote
1answer
38 views

Removing FMOD from a Unity WebGL project causes an error about not being able to copy fmod_register_static_plugins.cpp

When I imported the FMOD plugin into a Unity WebGL project, then removed it afterwards, I wasn't able to build it due to errors about trying to copy an FMOD file: fmod_register_static_plugins.cpp ...
0
votes
0answers
14 views

Unity WebGL Progress bar never moves but game finishes downloading and works

Not sure why but the progress bar never moves for WebGL in Chrome, but the game downloads and works? Using Unity 2020.1.14f1 brotli WebGL builds
0
votes
0answers
135 views

Unity3d FullScreen Mode Vertical Aspect Ratio in WebGl

My game has vertical aspect ratio and looks like this: When I press full screen button ...
0
votes
1answer
268 views

How can I import an Excel file in an Unity WebGL game?

Currently, we have a project that runs on Windows and uses an Excel spreadsheet to save/retrive some data/information. Now we want to build that project for WebGL. The problem is that file reading ...
3
votes
1answer
98 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: ...
1
vote
1answer
73 views

The rightmost part of the game screen is truncated in HTML

I created a game that, when I play it in Unity, looks like this: But when I build it in WebGL, the rightmost part of the screen (with the red player character in it) is truncated: Play it in-browser ...
0
votes
0answers
32 views

Unity WebGL Canvas only loads on select machines

https://herbertjoseph.com There is a WebGL build in the background of this site, and it doesn't seem to laod on my iPad. I've asked a few people to visit and check it out, and some have said that the ...
0
votes
0answers
36 views

WebGL Bulge Effect by Editing Library

I'm creating a game using CreateJS, a JavaScript library for (in this case) WebGL rendering. I have no experience with WebGL or WebGL shaders, so this is new territory for me. I want to create/add a ...
0
votes
1answer
81 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
0answers
21 views

Unity WebGL loading memory issue

I use unity 2019.3 and compile my solution for WebGL, but when I try load it in the Chrome or Safari I get an error, but it works fine in the Firefox. I'm a new in the Unity and not familiar with a ...
1
vote
0answers
50 views

Techniques for cursor snap-to-vertex in WebGL or OpenGL?

What's a technique for snapping the mouse pointer to vertices in WebGL or OpenGL? All I need is the vertex position, no other info. Ideally, I'd like to do this without needing to keep positions and ...
0
votes
0answers
27 views

Apply Filters to WebGL Canvas Itself

I am making a game in JavaScript and rendering it to a WebGL canvas. To give the game some extra spice, I'd like to create filters (or perhaps they're called "Shaders?") to apply directly onto the ...
2
votes
0answers
77 views

THREE.ShaderMaterial cannot perform antialiasing

I created a ShaderMaterial to draw a box in three.js using the following key code: ...
1
vote
0answers
71 views

Why would running WebGL app in Edge improve performance in Firefox?

I have a WebGL app (built using Unity 2019) which I'm testing locally in Firefox and Edge. If the app is only running in a tab in Firefox, it runs at 25 - 50 fps and has noticeable stutter. If I run ...
0
votes
0answers
58 views

Is it more performant to index in the vertex shader or fragment shader?

I have a shader that draws 2D quads from a texture atlas using instancing. I'd like to add a feature that allows me to map each of the RGBA channels in the texture using a 5x5 matrix. For example, the ...
0
votes
2answers
115 views

How does lookAt matrix math work?

Can someone provide me an explanation of how the lookAt matrix works? ...
0
votes
1answer
201 views

How can I fix the artifacts near the shadow edges in my variance shadow map?

I'm trying to implement variance shadow mapping in my engine. I'm using WebGL 2 and now I have only one directional light source. It's working, but it has a serious issue near the shadow edges and I ...
0
votes
0answers
69 views

What are the options when float textures aren't precise enough?

I am currently experimenting with rendering planetary scale terrain. I am generating the terrain on the GPU with noise, and to fix the 32 bit floating point precision problems, I generate the ...
0
votes
1answer
25 views

Unity3D in WebGL the Player doesn't have animations

I using Unity 2019.2.14f1 to create a simple 3D game. I want to build the project for WebGL, but, even though the player has animations on Unity, in the web the Player doesn't have animations even ...
0
votes
0answers
266 views

WebGL fragment shader pixel position

I have written a fragment shader, on a shape which is a square made with gl.TRIANGLE_STRIP, and which displays a radar: To build the radar, I'm using distance from ...
0
votes
1answer
116 views

Stuttering when using movetowards in a coroutine

I have the following problem with a WebGL project I'm working on: I have an object which I want to zoom out and move to a specific position at the same time, for this, I've created a coroutine which ...
0
votes
1answer
367 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
46 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 ...
-1
votes
1answer
693 views

threejs lerp and camera the animation is not smooth

what is the problem with linear interpolation? in update() in case this is animate() and when I call zoomCamera() in update() there is lerp with smooth but when I call here ...
1
vote
0answers
150 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 ...
0
votes
1answer
718 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 ...
-1
votes
1answer
202 views

WebGL-HTML5 canvas in two blogger blog posts show individually but not together?

In my blogger blog: https://cglabprojects.blogspot.com I have a newer blog post with <canvas width = "570" height = "570" id = "my_Canvas1"></canvas> ...
0
votes
1answer
567 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
486 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
295 views

WebGL Freeze for some minutes after loading asset bundle

I have to Load/Unload models from a specific URL based on player position. For this reason I am checking player position from model and then load/unload related piece of model in a ...
0
votes
1answer
115 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
1answer
804 views

Why WebGL Audio isn't working?

I need to download audio (OGG, Mp3 or wav) from URL and play it. In Editor is working fine, and also in stand alone build. But not in WebGL build. My Code: ...
1
vote
1answer
2k views

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

I would like to know if there is a solution to copy/paste the text from/to an InputField in a WebGl Unity app. Edit: for security reason, Unity WebGL doesn't allow text copy and paste in/from browser....
0
votes
0answers
41 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
3answers
738 views

Open world loading/unloading with asset bundle in unity

I have a very large environment which I have to load/unload in unity Webgl as I can't load them at once. So, I have divide the environment into 1000 x 1000m (1km) (each chunk is consist of three layer ...
0
votes
1answer
184 views

WebGL - two different approaches to Point Light: what is the difference?

So I'm studying Webgl and after directional light I'm approaching point light. So I've seen two different approaches: Take the directional light (diffuse and specular components) and multiply them ...
2
votes
2answers
784 views

Webgl page heap size increasing in each page load then crash

I am getting aw snap or sometime not enough memory problem when I reload my webgl page. I have a webgl project which is empty (just a camera + light), developed in unity3d. I am reloading it, and ...
0
votes
1answer
72 views

How to calculate/structure/define rotation vector for OpenGL / WebGL

I am trying to define the buffer data for WebGL and want to have in there something that encodes the fact that an object might be rotating. So it makes me think of angular momentum. So if you have ...
1
vote
0answers
83 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
2 3 4 5 6