Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
41 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 ...
0
votes
0answers
140 views

Unity - WebGL - Accessing AssetBundles to load prefab using Google Chrome, Firefox, etc

I'm attempting to create my own model viewer to be used on an MVC site of my own creation. I've got things to the point where the Unity WebGL player will load within the context of the page (it has ...
2
votes
2answers
117 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
57 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
86 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
87 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
216 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
0answers
64 views

Multitexturing: arbitrary number of textures and UV sets

In the vein of Photoshop or After Effetcs work, our users can composite an arbitrary number of layers and drive fragment colors and opacity with the result. A layer is: either a texture or arbitrary ...
0
votes
1answer
194 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
587 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
947 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
130 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
2k 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
98 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
91 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 ...
0
votes
1answer
281 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 ...
0
votes
0answers
64 views

Quads with different texture not rendered

This question seems to be a little broad, but I still think a generalization might help others. I have two textures (solid textures UintArray([255,0,0,255]). And my question is around the draw calls....
1
vote
1answer
154 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
223 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
163 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
108 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
52 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
702 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
246 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
163 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
149 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,...
2
votes
0answers
158 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 ...
9
votes
3answers
784 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
2k 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
327 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
174 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
711 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
329 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 ...
0
votes
1answer
103 views

WebGLRenderingContext.texImage2D does not implement interface ArrayBufferViewOrNull

I'm working on a WebGL project and all my textures render fine. When i wanted to implement a cubemap i started getting this type error. ...
0
votes
0answers
232 views

Unity build error: “Could not find file…build.asm.js ”

I made a WebGL game and the first few times it built well, then I continued working on it a bit and when I build it it gives me an error (and does not generate the build files), error: ...
1
vote
1answer
172 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 ...
0
votes
0answers
97 views

How do I rotate images/sprites I am using with webgl? Is this supported?

I would like to import a few sprites the the screen, in the browser using html/webgl. I already know how to do this. Then, once they are on the screen I would like to manipulate them with the keyboard....
1
vote
1answer
58 views

How to keep triangles from connecting across voxel mesh

I am working on a voxel engine and have just started learning webgl. I have generated a list of Vertices and Indices by using Array.concat() on a template array and adding a value based on my position ...
1
vote
1answer
749 views

Javascript game engine that can work 'seamlessly' with react-native [closed]

I have experience with Unity, but I don't like the fact that Unity compiles your game directly into APK (or IOS equivalent). I want to modify the game to provide chat interface for multiplayer mode ...
0
votes
1answer
63 views

What's wrong with this camera implementation?

I'm using WebGL and glMatrix and I implemented a camera. When a move backward, no problem. But when I move to the side and particularly forward, the camera becomes all glitchy. I implemented almost ...
1
vote
0answers
50 views

Asymetric Perspectiv View

I am building a addon component that will show synthesized 3D view of the world (kind of FLIR camera simulation). The problem I am facing is that currently I am using Symmetric Perspective View with ...
1
vote
2answers
727 views

In WebGL, how can I efficiently render a mesh many times per frame, without instancing?

I'm using WebGL and I want to render a single mesh many times at different locations. I know about WebGL 2's drawArraysInstanced() and ...
1
vote
0answers
59 views

WebGL frame rate slows down after triggering javascript event

I am using Unity WebGL to host my game on a flask server and trying to throw a warning to the user whenever he tries to navigate away from the tab or mistakenly click browser's back button. Each time ...
0
votes
0answers
369 views

real time lights and high quality shadows in webgl build

I have a game in which there are a lot of objects constantly moving around and a lot of real time lights with their setting set to highest, I'm building my game as webgl and this is costing me a lot ...
1
vote
0answers
947 views

webgl draw call batching and optimizations

I'm working mostly with three.js and webgl, i have some experience with unity. I don't consider three.js a game engine, more of a "rendering library" - something that takes care of the GL ...
0
votes
1answer
238 views

Unity3D 5.5b : C# WebGL open email client Win32 exception error

I want to send an email in a WebGL build using C#. My code is as below ...
1
vote
0answers
575 views

Lighting doesn't work properly in WebGL build only at one place

So I have a 2d game where a player walks around the level (top view) with a flashlight in front of him. Everything works fine in the editor, however whenever I build it for WebGL and test it in my ...
0
votes
1answer
290 views

Reset Camera view - webgl

I have camera rotating by dragging mouse. Im trying to add reset button that restart the scene to initial view. The rotating camera works as expected but I can't figure out how to reset it. The ...
0
votes
0answers
127 views

Stretchable Mesh Generation Techniques in 2D and 3D (Unity)

I wanna to generate such mesh (or smth like) that can be "Stretchable". Yellow objects in the picture are nodes and red ones are edges of my graph. I want to generate "edges mesh" can be stretchable ...