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
-1
votes
1answer
42 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
77 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
63 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
133 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
32 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
201 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: ...
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 ...
1
vote
0answers
276 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
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
3answers
226 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
56 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
162 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
31 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
40 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
107 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 ...
0
votes
1answer
44 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
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
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
1answer
867 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
161 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
2k 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 ...
2
votes
2answers
244 views

What are “free vertex indices” in WebGL 2 and how do they relate to geometry shaders?

In January Notch tweeted about WebGL 2: WebGL 2 is happening. Bye, compatibility! Hello, 3d textures and pixel buffers! oh god it's got free vertex indices in the shader. That is basically a ...
0
votes
1answer
147 views

How to use Facebook Web Hosting for my Unity Game for both WebGL and GameRoom

As can be seen from the Facebook's official Docs It says that To have both a Gameroom and a Facebook Web Game, you should leave your Facebook Web Games URL (https) unchanged. For example, https://...
1
vote
0answers
95 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 ...
0
votes
2answers
182 views

Which UVs to use when I have more UVs coordinates than vertices Obj

I have a simple sphere exported from 3DS Max in .obj format. I noticed that I have more UVs than vertices. I parsed the file with a simple program I wrote and then I put the various vertices and UVs ...
1
vote
1answer
676 views

WEBGL antialias false to pixel art low resolution

I know this issue maybe repeated and seems to be very common but I searched first and did not find anything concrete. I am doing some test and playing around with pixijs. I created an stage 320x180 ...
0
votes
1answer
419 views

Why is depth test not working properly in my code?

http://jsfiddle.net/w9WqJ/31/ When rotating the camera, some pieces that are supposed to be hidden are displayed. Should I create more triangles or what did I do wrong here?
0
votes
1answer
911 views

Change shadervalues for different Meshes in Three.js

Hey I am writing a Shader for Three.js. My goal is to have multiple objects with the same shader and each object should have a color set on the object that is then given to the shader. The goal is to ...
1
vote
1answer
2k views

unity webgl scale page on different sizes of internet browsers on pc or phone

unity only has a fixed resolution for building webgl. how can I make it changebale on users browser size change. there are some tutorials on the internet that doesn't match. there is only ...
1
vote
0answers
298 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: ...
3
votes
1answer
4k views

lookAt with orthographic camera (gl-matrix)

Technically this is a webgl question though I think it's generic enough to get some opengl, erm, perspective on it too... If I setup an orthographic camera (perspective matrix) like this: ...
0
votes
2answers
158 views

Rendering a 2D tree in WebGL

Assume a tree of objects that need to be rendered, each with their own x/y coordinates. Now let's say I could crawl through the tree and give each element a "z" coordinate, before rendering. Is ...
1
vote
1answer
142 views

Viewport for pixelart (WebGL)

I'm trying to display 16x16 pixel art textures (all textures have 16x16), but they are not displayed how I expected (they are ...
1
vote
1answer
429 views

Unpacking Sprite Sheet Into 2D Texture Array

I am using WebGL 2. A tag for it does not exist but it should. I have a 10x10 sprite sheet of squares that are 16x16 pixels in size (all in one PNG image). I'd like to create a 2D texture array out ...
1
vote
1answer
238 views

How to adapt a webgl shader using mouse position to have symmetrical behaviour

I'm trying to create a particular kind of effect for the background of my SpriteKit game, and I've found some shaders on shadertoy that are close to what I want, but I'm struggling to adapt them to do ...
0
votes
1answer
285 views

Efficient Dynamic Memory Management

My world is procedurally generated. As the player moves, chunks behind them are unloaded and chunks in front of them are loaded. Each chunk has a mesh of triangles. At the moment, I create two VBOs ...
1
vote
1answer
192 views

Removing/Updating Spritebatch

I am designing a Spritebatch class, for static and dynamic objects with WebGL. A problem I'm facing is that I have read several different opinions on sprite batching but with one goal. Put all ...
3
votes
1answer
165 views

GLSL ES 2.0 alternative for dFdxFine

I'm trying to generate normal map on the fly in fragment shader. The implementation I've found is using dFdxFine function, which can't be used in WebGL, is there any alternative for dFdxFine in GLSL ...
0
votes
1answer
57 views

Are there any math limitations on the near plane in a perspective matrix?

I've noted that if in the perspective camera I put near plane to a low number like 0.000001 and far plane to 1000 my render has ...
0
votes
1answer
911 views

WebGL .NETCoreApp 1.1 - UnityLoader.js - SyntaxError: expected expression, got end of script

After creating a release build of my game using Unity 5.6, I could navigate to the created folder and open the 'index.html' file and my game would load and play normally. However, when trying to ...
0
votes
1answer
361 views

How to display full website in Unity WebGL?

I want to display the complete website within the WebGL in Unity. I have tried Awesomium plugin but it doesn't work in WebGL. Please tell me is there any way to display the webpage. Thank you.
1
vote
1answer
216 views

How to calculate a projection of 360° equirectangular slides?

My goal is to have a light source inside of a transparent sphere that has an equirectangular texture to act as a 360°-slide. I want to get the projection on arbitrary objects as a texture image on ...
0
votes
3answers
230 views

Unstable sampled color in GLSL shader

It looks like that sampling the same exact color data from different areas of a texture atlas results in different vec4 in the GLSL fragment shader. In other words,...
1
vote
0answers
195 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 ...
8
votes
3answers
973 views

Noisy edges, smoothing out edges between faces via fragment shader

I have a generated terrain, with hexagonal geometry, as per screenshot below: I then generate biomes, but as you can see the borders between them are really ugly and straight. To hide that hexagonal ...
0
votes
2answers
3k views

How to rotate something around a fixed point WebGL

I have created a simple robot in webgl with cubes and now i want to rotate one "leg" around a point. But the leg is rotating around its origin. I want to rotate it around the point that connects with ...
1
vote
1answer
493 views

2D Websocket WebGL game

Inspired by BrowserQuest, I want to try my hand at making my own kind of game like this but I don't really know anything about game development other than the basics, like how the game loop works. ...
1
vote
0answers
246 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
1answer
945 views

2d game with 3d js. game engine

I'm trying to understand if it's possible to create a game where the player can switch between 2d (strategic/bird view) and 3d (actual gameplay) using only the 3d supported JS/HTML5 game engine, like ...
1
vote
0answers
388 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 ...