Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
1answer
171 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 ...
16
votes
2answers
5k 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 ...
6
votes
2answers
2k views

Low quality bilinear sampling in WebGL/OpenGL/DirectX

I'm seeing low quality bilinear texture sampling in WebGL, OpenGL and Directx, and was wondering if anyone knew how to make it higher quality? The picture below should help show what I mean. The ...
1
vote
1answer
814 views

Problem when animating MD5 model (GPU Skinning)

I'm trying to implement a GPU skinning version of the md5mesh.js by @tojiro (demo with CPU skinning) in WebGL (live demo of the project here, use WASD to move the camera around). The main concept is ...
29
votes
10answers
13k 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 ...
19
votes
3answers
10k views

Is there a way to use an arbitrary number of lights in a fragment shader?

Is there a way to pass an arbitrary number of light locations (and colors) for the fragment shader, and loop over them in the shader? If not, then how are multiple lights supposed to be simulated? ...
6
votes
2answers
4k views

Rendering 2d sprites into a 3d world?

In opengl how do I render 2d sprites in opengl given that I have a png of the sprite? See images as an example of the effect I'd like to achieve. Also I would like to overlay weapons on the screen ...
8
votes
1answer
6k 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...
6
votes
2answers
6k views

scaling point sprites with distance

How can you scale a point sprite by its distance from the camera? GLSL fragment shader: gl_PointSize = size / gl_Position.w; seems along the right tracks; for any ...
4
votes
3answers
2k views

why is it faster to draw lots of small arrays than one big array?

This application on-line here has interesting performance characteristics: Sorting the rectangles to be drawn so it keeps having to change colour is faster than sorting the rectangles by their colour ...
1
vote
2answers
1k views

Ward model implementation: specular component too weak

I'm trying to implement the Ward shading model, the anisotropic, computationally efficient version: This is how I made it: ...
0
votes
1answer
50 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 ...
0
votes
3answers
238 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
131 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 ...