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
30
votes
10
answers
16k
views
Browser-based MMOs (WebGL, WebSocket) [closed]
Do you think it is technically possible to write a fully-fledged 3D MMO client with Browser JavaScript - WebGL for graphics, and WebSocket for Networking?
Do you think future MMOs (and games generally)...
17
votes
2
answers
8k
views
How can I simulate a limited (256) color palette in OpenGL?
On Twitter, I found this screenshot of a game in development:
The image on top seems to be without any color limitation. But the two other pictures at the bottom have a 256 color palette.
I want to ...
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 ...
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 ...
10
votes
3
answers
5k
views
Performance degrading when resolution increases for a 4k screen
I am new to Unity.
I have a problem where my game has good performance on my non-4k screen.
Bur when I play it on my 4k screen, the performance gets really bad.
It looks like the resolution is ...
10
votes
3
answers
7k
views
How to implement mouselook in the browser?
I am currently creating a 3D first-person shooter game in the browser using WebGL. How would I implement mouselook/free look for such a game?
8
votes
3
answers
4k
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 ...
8
votes
1
answer
8k
views
GLSL pack floats into an RGBA texture
I want to compose conventional triangle-based models and particles with a ray-traced scene at a reasonable frame-rate.
webGL does not let you write the gl_FragDepth...
7
votes
1
answer
621
views
Should the Oj lobe of a Lafortune shader cause the light to be displaced?
I implemented the Lafortune shader in WebGL, and my biggest concern is about this formula:
Explanation
Kd/Ks is the material diffuse/specular color, ρd/ρs is the light diffuse/specular component, ...
6
votes
1
answer
2k
views
How do I create a blob shadow under a character?
I have a webgl based 2.5D platformer game, and I would like to add a simple blob shadow under the character to help the player with the platforming.
How is this normally done?
As you can see below, ...
6
votes
1
answer
6k
views
What's the difference between Canvas and WebGL?
I'm thinking about using CAAT as a part of a HTML5 game engine. One of it's features is the ability to render to Canvas and WebGL without changing anything in the client code. That is a good thing, ...
6
votes
2
answers
3k
views
How to animate a model in WebGL?
I created a human model in Blender, exported the vertices and indices into a JSON file and render the model in a browser using WebGL. Now I created a walk and jump animation in Blender and would like ...
5
votes
3
answers
6k
views
Can Simple Direct Media Layer be used with WebGL?
I have read that on desktop OpenGL + SDL is a great way to learn. In looking at WebGL I couldn't find a Web version of SDL. On their site I see bindings for all sorts of languages, but no JavaScript. ...
5
votes
2
answers
3k
views
blending with the foreground but not the background
I want to draw some very-semi-transparent objects on top of my scene and have them blend nicely with the other pixels in the scene, but not blend with the background; if I draw a semi-transparent ...
5
votes
3
answers
7k
views
How do I load Collada models into a WebGL app? [closed]
I have written some simple apps following the tutorials on http://learningwebgl.com. What is the simplest way to load and display Collada model files, particularly the files available from Google 3D ...
5
votes
2
answers
2k
views
Confused about Max Vertex Uniform Vector limit
While coding my WebGL app I've encountered an interesting phenomena:
On my first PC (with GPU Radeon HD 5850), BrowserLeaks (link) tells me that in my browser - Google Chrome Version 36.0.1985.143m ...
5
votes
0
answers
301
views
Virtual infinite plane in shadow map
I have a WebGL deferred rendering pipeline, where I'm rendering shadow map with VSM technique. The goal is that the scene, or model, is hovering in space, and in addition to casting shadow on itself, ...
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". ...
4
votes
1
answer
2k
views
How can I render a single object that uses multiple textures?
I'm looking for a technique to render an object with multiple texture sources. One texture is static, the other is generated dynamically (it's a render target). For example, say I was rendering a TV. ...
4
votes
1
answer
3k
views
How can I restrict the rotation of an object to a subset of axes using quaternions?
I've got a question about quaternions in my WebGL application.
How can I rotate an object only around two axes? For example, how can I exclude/nullify rotation about the Y axis?
The problem is that ...
4
votes
1
answer
159
views
Timers and performance for mobile JS
I'm using the Three.js JavaScript library to do some things in WebGL, and I wonder how the graphic aspects of timers are done on mobile.
I was creating numbers with geometries and just replacing them ...
4
votes
0
answers
1k
views
LibGDX's HTML project doesn't show anything in Browser
The question is self explanatory, when I run my demo-html project as a Web Application and I open Chrome with the provided link by eclipse, my browser doesn't show the image it is supposed to show in ...
3
votes
2
answers
974
views
Loading chunks of the terrain relative to the player's position
I'm making a small voxel-based multiplayer WebGL game with a Node.JS server which handles player positions and sends terrain chunk data to the clients. This is an example of how I'm currently sending ...
3
votes
1
answer
3k
views
Unity3d or WebGL: Where should I go?
I am interested in making a simple 3D game this summer, and I'd prefer if it were playable in a browser. My choices I am considering are Unity and WebGL. Currently I have no experience in either. But ...
3
votes
1
answer
2k
views
What are the texture coordinates for a tetrahedron
EDIT This is the WebGL code for initializing the tetrahedron points. You may want to skip to the second code block, because you may be able to answer without this.
...