Questions tagged [webgl]

WebGL extends the capability of the HTML canvas element to allow it to render accelerated 3D graphics in any compatible web browser.

Filter by
Sorted by
Tagged with
2 votes
1 answer
350 views

Easing curves on the GPU?

I was thinking that I could pass a timestamp in (from requestAnimationFrame) to the vert shader, and just have my easing curves in the GPU instead of using (for example) Tween.js from the outside. Is ...
  • 255
1 vote
0 answers
205 views

How To Generate High Quality Bitmap From Canvas For WebGL Texture

I would like to generate a bitmap for use with a webgl texture generated from a 2d canvas, but I don't think I am doing it correctly. I know how to display the contents of one canvas into another by ...
  • 31
4 votes
2 answers
548 views

Can a scene graph be stored in the GPU?

I am starting to learn WebGL. Can a scene graph be stored in the GPU? Or is that type of thing more for the main thread (or webworker)? For example, I want to calculate some layout, and apply it as a ...
  • 255
2 votes
0 answers
530 views

Creating Signed Distance Fields Images On The Fly For WebGL Application

I am working on a "CAD" like program in HTML5 that requires drawing many thousands (700,000+) of images on the screen. I think, "fortunately" the many images are replicated uses of a unique set of ...
  • 31
1 vote
0 answers
44 views

View / print index values?

So i'm currently trying to draw a 3D cube, and from what I understand everything should be working right, but It's coming out weird and I believe it's because the ordering of my indexes is wrong. Is ...
  • 19
1 vote
0 answers
371 views

How does this function calculate normals of a mesh? [closed]

I have trouble understanding the following Javascript code. It calculates, given a mesh described by its vertices vs and indices ...
  • 321
9 votes
0 answers
506 views

WebGL packing/unpacking functions that can roundtrip all typical 32-bit floats

I have a WebGL circuit simulator. One of the problems it has is that, due to using quite a lot of intermediate float textures as it simulates, it doesn't work on various mobile devices. They only ...
3 votes
1 answer
1k views

How to clip multiple tiled textures to polygon in Webgl / opengl

I have a bunch of planes each with their own texture in a grid. Currently I am rendering these as separate planes, each with their own texture, although I could use a single plane with multiple faces. ...
  • 131
5 votes
1 answer
393 views

Optimizing performance on hardware

I'm working on a webgl audio visualizer that uses particles, and I want to optimize rendering based on the user's hardware. I'd like to offer a "low quality" and "high quality" setting so that it ...
  • 153
0 votes
2 answers
683 views

Only show opaque objects behind transparent objects

I would like to make certain objects in my scene transparent, but only the parts visible to the camera when opaque. Currently, when I make objects transparent, I can see other transparent objects ...
  • 131
5 votes
1 answer
1k views

Can we use PhysX in WebGL?

I'm new to GL stuff (coming in via WebGL, with no direct OpenGL experience). Can we use PhysX with WebGL?
  • 255
1 vote
0 answers
137 views

Can I Implement Clustered Lighting with WebGL?

Do current WebGL capabilities allow to use Clustered Lighting? If not what is it missing to allow that? Basically WebGL uses GLES 2, so is that possible with GLES 2? I want to implement this one: ...
3 votes
0 answers
277 views

What does these FXAA settings do?

I been looking for a way to do anti-aliasing with deferred rendering with WebGL as my target platform. WebGL does not support multisampled FBOs. I found FXAA implmentations such as this https://github....
4 votes
1 answer
259 views

Rendering same vertex-array in different modes

here is my vertex array I am using: ...
4 votes
1 answer
2k views

How to use 32 bit Integers for Element Indices in WebGL 1.0?

WebGL 1.0 specification does not allow to create 32-bit index buffers. Now I'm in trouble, I'm trying to render huge objects with 100 thousands to 1 million indices. In OpenGL this is no issue at all, ...
  • 703
2 votes
1 answer
394 views

Why does substracting -1 in shader fail for a float data type?

I am loading a texture in a WebGL fragment shader (GLSL version 1.00). This is my working code: ...
  • 703
5 votes
2 answers
1k views

Is it possible to store the plain buffer data in gltf files?

The GL Transmission Format comes along with a JSON styled main file which basicly describes the scene and binary files which contain the buffers. I'm currently writing a WebGL library and I need to ...
  • 703
1 vote
1 answer
5k views

How to load a model in .json in three.js

I need to load a model "somemodel.json" into my "movie.js".Can someone tell me where i am going wrong.I followed the steps given here. index.html ...
14 votes
2 answers
10k views

What is an index buffer and how is it related to vertex buffers?

I have a vertex buffer like this: 0.0, 0.0, 1.0, 0.0, 0.0, 0.6, 1.0, 0.6, 0.5, 1.0 I have the following index buffer: ...
  • 703
6 votes
1 answer
113 views

gamma transform in webGLSL: when already done or yet to be done?

Color spaces issues are such a pain, especially when you create color data at the middle of the chain, and a pile of libs and apps separate this to the display... Here I only worry about gamma ...
5 votes
1 answer
506 views

Bitpacking into buffers with webgl (shadertoy)

I'm working on a webgl pixel shader which is writing to a 16 bit floating point buffer (each color channel r,g,b,a is a 16 bit floating point number). I'm trying to figure out if there are any decent ...
  • 7,711
6 votes
1 answer
1k views

How much should I rely on Geometry shaders in WebGL?

Geometry shaders appear to have been introduced in 3.2, which makes me wonder how common 3.2-enabled cards are, including support for Geometry shaders within WebGL contexts. Will I be cutting out a ...
8 votes
1 answer
131 views

Cost of parameter passing in webgl pixel shaders?

In a webgl pixel shader, all functions are inlined as i understand it, however you can have parameters that are marked as in versus being inout meaning that their value can change but the value won't ...
  • 7,711
5 votes
3 answers
3k views

Is it possible to create minimal glTF files with vertex and index buffers?

I am currently looking into glTF to use as a transfer format for my WebGL project. I already have the geometries I wish to render on my WebGL client available as preprocessed vertex and index buffers (...
  • 703
6 votes
1 answer
310 views

Drawing a cube a million times

I need to build terrain using one cube with dimensions 1x1x1, the coordinates are provided in a .txt file and there are about 11M triplets. The problem is that using my current code I can only draw ...
  • 161
10 votes
1 answer
991 views

WebGL Omnidirectional Shadow Mapping Issue

First of all, I want to say that I've read a lot of post about shadow mapping using depth maps and cubemaps and I understand how they work and also, I have working experience with them using OpenGL, ...
  • 171
9 votes
1 answer
220 views

Help me find out what this texture mapping technique is called

I'm in the process of making a tool that requires rendered texture to follow the contours of a piece of clothing. An example would be this website https://knyttan.com/editor/jumper-editor/. The effect ...
4 votes
2 answers
4k views

Are there any gltf example datasets available? [closed]

I'm currently researching my options on effeciently exchanging data for a webgl application. I understand the gltf format is still being drafted but I need some example data to understand whether this ...
  • 703
9 votes
1 answer
259 views

Can I determine the pixel geometry programmatically?

Different screens can have different pixel geometry, so that the red, green and blue components are arranged in different patterns. Using sub-pixel rendering to give a higher apparent resolution is ...

1
2