Category "webgl"

How to include shaders as external files

Is there a way to include this shader code as an external vertexShader.js without quotes and include between "script" tags? var vertCode = 'attribute vec3 coor

WebGL2: what is up with max elements indices/vertices?

I'm developing a web component using WebGL2 (and three.js) with OES_element_index_uint enabled. I'm drawing a geometry using indexed vertices and I'm seeing th

I have a Unity WebGL game uploaded. Is it possible to manually create a persistent directory in /idbfs inside IndexedDB?

In the Unity project, I attached a script in an empty game object, and the code is demonstrated below: Is it possible to create a persistent directory myself? p

Unity WebGL unsupported MIME type

I'm starting a new blank project for webgl. I'm using Unity 2020.3.26f1 (LTS). When I launch the project on my wamp server I get this error: wasm streaming comp

Render an array of rgb pixels on a canvas

I have this problem, I have a socket that sends me packets each one containing a row of a frame. Using python I reconstruct the full-frame as an array of RBG pi

What is the logic of binding buffers in webgl?

I sometimes find myself struggling between declaring the buffers (with createBuffer/bindBuffer/bufferdata) in different order and rebinding them in other parts

Audio spatialization with WebGL

I currently work on a little Project, where I render a CubeMap with WebGL and then apply some sounds with the "web audio API" Web Audio API Since the project is

Creating a Gradient Color in Fragment Shader

I'm trying to achieve making a gradient color as the design apps (Photoshop for example) does, but can't get the exact result i want. My shader creates very ni

Should WebGL shader output be adjusted for gamma?

Should a WebGL fragment shader output gl_FragColor RGB values which are linear, or to some 1⁄γ power in order to correct for display gamma? If the l

Morph Targets Three.js

I'm trying to get started with morph targets and three.js. However, there doesn't seem to be much documentation on this subject. As I'm looking at the source co