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
16 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
27 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
13 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
18 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
19 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
16 views

THREE.ShaderMaterial cannot perform antialiasing

I created a ShaderMaterial to draw a box in three.js using the following key code: ...
11
votes
3answers
794 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 ...
-1
votes
0answers
14 views

Kafka Consumer not getting message when using coroutine in unity

I have this Kafka consumer example with threading which I want to use it without threads, therefore, converting it to coroutine for webgl player as threading is not supported in webgl. And this is the ...
-1
votes
0answers
26 views

How to access in-game stats of a Unity WebGL game(Subway Surfers)?

This is the link to the game. I want to extract some basic in-game information like score and whether or not the player died. I tried inspecting the page, but I couldn't find a single Javascript file ...
0
votes
2answers
66 views

How does lookAt matrix math work?

Can someone provide me an explanation of how the lookAt matrix works? ...
1
vote
0answers
22 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
47 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
0answers
16 views

How to cover game view with game background borders

I have a game view that displays the game but I don't want to show the edges of this view. I have background that covers this game view around the edges, so the game view is in the middle borders show ...
0
votes
1answer
290 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
1answer
64 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 ...
4
votes
2answers
1k 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 ...
2
votes
1answer
74 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 ...
0
votes
1answer
57 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
42 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
0answers
12 views

Why won't my audio listener activate on awake when ported to WebGL? [Unity 3D]

When I poked around the documentation for WebGL builds in Unity, I read that WebGL places limitations on some of the audio features typically allowed in Unity. It does however confirm that the ...
0
votes
0answers
33 views

WebGL not rendering properly without fullscreen

I've written simple WebGL code intypescript to render some graphics on the screen. But when I implemented lighting I noticed ...
0
votes
1answer
19 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 ...
2
votes
2answers
366 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
0answers
130 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
44 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
74 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
42 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
324 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
58 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
0answers
145 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
98 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
0answers
233 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
196 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
408 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: ...
3
votes
1answer
6k views

Orthographic Camera and Raycasting in Three.js

I'm working on a test project porting a simple game from iOS to Javascript. I've got the orthographic camera working and it can view the objects in the scene and move up and down the tower of meshes ...
1
vote
0answers
860 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. ...
0
votes
0answers
38 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
391 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 ...
-1
votes
1answer
55 views

The types of buffers typically used in robust WebGL/OpenGL apps

I am trying to get a feel for how to structure WebGL/OpenGL apps and have been looking through sources for the types of buffers they use. I've found these: uvs occlusion noise bitangents tangents ...
0
votes
1answer
349 views

Why are some of my normals facing away from the camera?

I'm trying to use WebGL to render some simple models, and I'm running into issues where pixels near the edge of my model are passing normals to my fragment shader that point away from the camera. This ...
0
votes
1answer
108 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 ...
0
votes
1answer
46 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 ...
0
votes
1answer
263 views

How to use 2D textures in OpenGL / WebGL for physics [closed]

Following along the answer here, it was mentioned about textures: They can also store things like velocities. For example, you can use a texture as a "flow field" for animating particles or other ...
1
vote
0answers
48 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: ...
0
votes
1answer
76 views

How to use textures in 2D games in WebGL

I have been trying to figure out how to structure the VBOs in WebGL, and think that keeping them all together in one if at all possible sounds like the best approach. Right now I'm thinking of having ...
1
vote
1answer
4k views

How can I implement 3D textures using webgl?

I went through the google I/O video but did not get exactly how to do it. If somebody could point me to a simple 3D texture implementation using webgl, it would be helpful. i basically have a volume, ...
0
votes
1answer
2k views

“RENDER WARNING: there is no texture bound to the unit 0” When not Rendering Texture

I have a webgl program that sometimes renders textures, but mostly renders triangles or lines. When I am not rendering a texture, webgl gives the warning, "...
0
votes
1answer
250 views

How to generate or smooth really large procedural terrain?

I'm currently trying to generate a really large procedural terrain in WebGL. I use a quadtree for LOD and plan to generate 1 heightmap for each quadtree node (terrain patch). The heightmaps are ...
12
votes
4answers
3k views

Difference between “buffer” and “array” in OpenGL?

When I read doc on webGL or OpenGL there can be seen some patterns in how names of functions and objects are used. But I can't understand the difference between buffer object and an array. There are ...
1
vote
1answer
218 views

Offsetting ground texture doesn't work in WebGL

so I've created a 2D sidescroller game, the technique I used is to keep the player on the same place, and move the obstacles towards him. I also offset the ground and backdrop constantly to create the ...

1
2 3 4 5