# \#webgl2

**URL:** https://discourse.threejs.org/tag/webgl2/503.md

[Latest](https://discourse.threejs.org/latest.md) · [Categories](https://discourse.threejs.org/categories.md) · [Tags](https://discourse.threejs.org/tags.md)

---

## [Cryptix Universe – A Browser-Based Multiplayer Action MMO Built with Three.js](https://discourse.threejs.org/t/cryptix-universe-a-browser-based-multiplayer-action-mmo-built-with-three-js/93700)

<div class="topic-metadata">

**Author:** [@True\_Anonymous](https://discourse.threejs.org/u/True_Anonymous)\
**Replies:** 1\
**Last updated:** [August 23, 2026, 5:44pm UTC](https://discourse.threejs.org/t/cryptix-universe-a-browser-based-multiplayer-action-mmo-built-with-three-js/93700 "2026-08-23T17:44:43Z")

</div>

Cryptix Universe – A Browser-Based Multiplayer Action MMO Built with Three.js Hey everyone, we’ve been working on Cryptix Universe, a 3D multiplayer action MMO that runs directly in the browser, with Three.js handling …

---

## [A generative flow-field visualization](https://discourse.threejs.org/t/a-generative-flow-field-visualization/88795)

<div class="topic-metadata">

**Author:** [@fourd](https://discourse.threejs.org/u/fourd)\
**Replies:** 15\
**Last updated:** [January 25, 2026, 5:36pm UTC](https://discourse.threejs.org/t/a-generative-flow-field-visualization/88795 "2026-01-25T17:36:28Z")

</div>

Hi all, I wanted to share a production WebGPU project that doesn’t use Three.js — built from scratch with raw WebGPU APIs (with a WebGL2 fallback). Project: A generative flow-field visualization for a psychotherapy web…

---

## [What does 'pc\_FragColor' do in WebGL2 shaders?](https://discourse.threejs.org/t/what-does-pc-fragcolor-do-in-webgl2-shaders/21693)

<div class="topic-metadata">

**Author:** [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Replies:** 3\
**Last updated:** [January 26, 2025, 6:11pm UTC](https://discourse.threejs.org/t/what-does-pc-fragcolor-do-in-webgl2-shaders/21693 "2025-01-26T18:11:03Z")

</div>

I’m reading through the compiled shaders in MeshLambertMaterial, and I discovered that there are about 14 additional lines of #defines when using a WebGL2 context compared to a WebGL1 context. I have two questions: 1…

---

## [WebGL2 2D Texture Arrays](https://discourse.threejs.org/t/webgl2-2d-texture-arrays/10040)

<div class="topic-metadata">

**Author:** [@titansoftime](https://discourse.threejs.org/u/titansoftime)\
**Replies:** 4\
**Last updated:** [January 24, 2025, 1:57am UTC](https://discourse.threejs.org/t/webgl2-2d-texture-arrays/10040 "2025-01-24T01:57:26Z")

</div>

I am interested in implementing 2D texture arrays. I’ve pretty much got the code part down (I think), but I am a little lost as far as how to create the actual images. This example: https://threejs.org/examples/webgl2\_m…

---

## [Sharing uniforms between different programs](https://discourse.threejs.org/t/sharing-uniforms-between-different-programs/75426)

<div class="topic-metadata">

**Author:** [@rob-myers](https://discourse.threejs.org/u/rob-myers)\
**Replies:** 3\
**Last updated:** [December 21, 2024, 6:28pm UTC](https://discourse.threejs.org/t/sharing-uniforms-between-different-programs/75426 "2024-12-21T18:28:08Z")

</div>

I have many SkinnedMesh characters using a custom ShaderMaterial, which interprets a particular quad as a camera-facing “label” naming each character. A label amounts to rendering some words using some font, and they a…

---

## [Utsubo 2024 WebGPU Experiment](https://discourse.threejs.org/t/utsubo-2024-webgpu-experiment/60492)

<div class="topic-metadata">

**Author:** [@Yakuno](https://discourse.threejs.org/u/Yakuno)\
**Replies:** 7\
**Last updated:** [October 18, 2024, 7:36am UTC](https://discourse.threejs.org/t/utsubo-2024-webgpu-experiment/60492 "2024-10-18T07:36:25Z")

</div>

Hey there! I just dove into my first experiment with the new WebGPURenderer, and I’ve gotta tell you, it’s been quite the ride. I’ve been messing around with Three.js Shading Language (TSL) and Node Materials, trying to …

---

## [Simple Cube Shading Example](https://discourse.threejs.org/t/simple-cube-shading-example/70402)

<div class="topic-metadata">

**Author:** [@GitHubDragonFly](https://discourse.threejs.org/u/GitHubDragonFly)\
**Replies:** 4\
**Last updated:** [September 7, 2024, 3:51pm UTC](https://discourse.threejs.org/t/simple-cube-shading-example/70402 "2024-09-07T15:51:44Z")

</div>

This shading example just looks interesting and provides control over shading and rotation on both desktop and mobile devices as well as an additional control over mouse sprites on desktop devices. It includes a little …

---

## [Is GPU Object Picking possible with a single render?](https://discourse.threejs.org/t/is-gpu-object-picking-possible-with-a-single-render/70228)

<div class="topic-metadata">

**Author:** [@rob-myers](https://discourse.threejs.org/u/rob-myers)\
**Replies:** 5\
**Last updated:** [September 4, 2024, 1:09am UTC](https://discourse.threejs.org/t/is-gpu-object-picking-possible-with-a-single-render/70228 "2024-09-04T01:09:25Z")

</div>

Suppose I render a Mesh with a ShaderMaterial. Further suppose the fragment shader has the following form: layout(location = 1) out vec4 gObjectPick; // ... // shader code setting gl\_FragColor and gObjectPick // ... I…

---

## [Three.js WebGL2 uniform block objects](https://discourse.threejs.org/t/three-js-webgl2-uniform-block-objects/7895)

<div class="topic-metadata">

**Author:** [@Alejandro\_Insua](https://discourse.threejs.org/u/Alejandro_Insua)\
**Replies:** 13\
**Last updated:** [June 23, 2024, 2:59pm UTC](https://discourse.threejs.org/t/three-js-webgl2-uniform-block-objects/7895 "2024-06-23T14:59:42Z")

</div>

Hi. Some time ago, thanks to Michael Herzog I tested a very powerfull feature from WEBGL2 called Uniform Block Objects. Is there any roadmap to include this feature in the core of official THREEJS code? Best regards

---

## [WebGLMultipleRenderTargets with different texture format/types](https://discourse.threejs.org/t/webglmultiplerendertargets-with-different-texture-format-types/64938)

<div class="topic-metadata">

**Author:** [@Romulus2100](https://discourse.threejs.org/u/Romulus2100)\
**Replies:** 10\
**Last updated:** [May 2, 2024, 11:09pm UTC](https://discourse.threejs.org/t/webglmultiplerendertargets-with-different-texture-format-types/64938 "2024-05-02T23:09:56Z")

</div>

I am trying to create a WebGLMultipleRenderTargets (MRT) with three textures. My goal is for the textures of the MRT to have two textures be RGBA8 and one RG32F: // Create multipleRenderTarget var mrt = new THREE.WebGL…

---

## [Failed to execute 'shaderSource' on 'WebGL2RenderingContext'](https://discourse.threejs.org/t/failed-to-execute-shadersource-on-webgl2renderingcontext/59676)

<div class="topic-metadata">

**Author:** [@knight1972001](https://discourse.threejs.org/u/knight1972001)\
**Replies:** 6\
**Last updated:** [December 27, 2023, 12:46pm UTC](https://discourse.threejs.org/t/failed-to-execute-shadersource-on-webgl2renderingcontext/59676 "2023-12-27T12:46:20Z")

</div>

Hi everyone, I am facing this error: TypeError: Failed to execute 'shaderSource' on 'WebGL2RenderingContext': parameter 1 is not of type 'WebGLShader'. The problem only appears if I render more than 16 objects at the sa…

---

## [Transform Feedback in context of Three.js](https://discourse.threejs.org/t/transform-feedback-in-context-of-three-js/40783)

<div class="topic-metadata">

**Author:** [@stopyransky](https://discourse.threejs.org/u/stopyransky)\
**Replies:** 0\
**Last updated:** [July 27, 2022, 3:51pm UTC](https://discourse.threejs.org/t/transform-feedback-in-context-of-three-js/40783 "2022-07-27T15:51:28Z")

</div>

Hey All, I came across this post and saw the PR and related discussion on github which seems to be ending in a limbo. I created this post to hopefully discuss possible solution that would be inline with current three.j…

---

## [Can/should I use Three.js for high performance simulations?](https://discourse.threejs.org/t/can-should-i-use-three-js-for-high-performance-simulations/40734)

<div class="topic-metadata">

**Author:** [@ethanlipson](https://discourse.threejs.org/u/ethanlipson)\
**Replies:** 0\
**Last updated:** [July 26, 2022, 3:14am UTC](https://discourse.threejs.org/t/can-should-i-use-three-js-for-high-performance-simulations/40734 "2022-07-26T03:14:13Z")

</div>

I really love writing simulations and presenting them graphically using WebGL. Examples include: https://ethanlipson.com/demos/fluid https://ethanlipson.com/demos/metaballs-3d https://ethanlipson.com/demos/boids Thes…

---

## [How to use InstancedBufferAttribute with Uint8Array?](https://discourse.threejs.org/t/how-to-use-instancedbufferattribute-with-uint8array/39051)

<div class="topic-metadata">

**Author:** [@benzsuankularb](https://discourse.threejs.org/u/benzsuankularb)\
**Replies:** 2\
**Last updated:** [June 9, 2022, 7:18am UTC](https://discourse.threejs.org/t/how-to-use-instancedbufferattribute-with-uint8array/39051 "2022-06-09T07:18:52Z")

</div>

I’ve found that when I put Uint8Array into the InstancedBufferAttribute, WebGL fired an error for an invalid type. However, it works with Float32Array. I know we have UInt8BufferAttribute but are there any ways to ach…

---

## [Any danger allowing WebGL2 renderer?](https://discourse.threejs.org/t/any-danger-allowing-webgl2-renderer/38368)

<div class="topic-metadata">

**Author:** [@Mike\_D](https://discourse.threejs.org/u/Mike_D)\
**Replies:** 4\
**Last updated:** [May 23, 2022, 2:35am UTC](https://discourse.threejs.org/t/any-danger-allowing-webgl2-renderer/38368 "2022-05-23T02:35:49Z")

</div>

I just realized that my website/app, developed using threejs 123, is running under WebGL2 on modern systems. So far, it works fine, but I’m curious: are there any reasons I should be forcing my older code to WebGL1Ren…

---

## [Advantages/disadvantages of using WebGL2](https://discourse.threejs.org/t/advantages-disadvantages-of-using-webgl2/7717)

<div class="topic-metadata">

**Author:** [@looeee](https://discourse.threejs.org/u/looeee)\
**Replies:** 12\
**Last updated:** [December 18, 2020, 3:07pm UTC](https://discourse.threejs.org/t/advantages-disadvantages-of-using-webgl2/7717 "2020-12-18T15:07:56Z")

</div>

As stated in the How to use WebGL2 doc: By default three.js always uses a WebGL 1 context when creating an instance of WebGLRenderer . If you want use a WebGL 2 context, please have a look at the following workflow. …

---

## [What version of WebGL does three use?](https://discourse.threejs.org/t/what-version-of-webgl-does-three-use/19649)

<div class="topic-metadata">

**Author:** [@haangglide](https://discourse.threejs.org/u/haangglide)\
**Replies:** 10\
**Last updated:** [October 15, 2020, 5:28pm UTC](https://discourse.threejs.org/t/what-version-of-webgl-does-three-use/19649 "2020-10-15T17:28:39Z")

</div>

What version of webgl do three use? I want to use texelfetch and understand it does only work in webgl2 This is a dead link: https://threejs.org/docs/#manual/en/introduction/How-to-use-WebGL2

---

## [3D Brain Reconstruction with High Resolution MRI](https://discourse.threejs.org/t/3d-brain-reconstruction-with-high-resolution-mri/17966)

<div class="topic-metadata">

**Author:** [@dipterix](https://discourse.threejs.org/u/dipterix)\
**Replies:** 0\
**Last updated:** [August 18, 2020, 5:46am UTC](https://discourse.threejs.org/t/3d-brain-reconstruction-with-high-resolution-mri/17966 "2020-08-18T05:46:36Z")

</div>

Hey everyone, Thanks for developing such an amazing library. I’m working on a neuroscience project that visualizes reconstructed high-resolution MRI image. Here is a demo of its 3D viewer: https://dipterix.github.io/

---

## [fragDepth error / 'gl\_FragDepthEXT': undeclared identifier on release 119](https://discourse.threejs.org/t/fragdepth-error-gl-fragdepthext-undeclared-identifier-on-release-119/17685)

<div class="topic-metadata">

**Author:** [@fedeMarino](https://discourse.threejs.org/u/fedeMarino)\
**Replies:** 3\
**Last updated:** [August 6, 2020, 10:20pm UTC](https://discourse.threejs.org/t/fragdepth-error-gl-fragdepthext-undeclared-identifier-on-release-119/17685 "2020-08-06T22:20:36Z")

</div>

Hi, I’ve just updated my three.js file from r111 to r119 and I’m getting an error when compiling a rawShaderMaterial. The error states THREE.WebGLShader: gl.getShaderInfoLog() fragment ERROR: 0:656: 'gl\_FragDepthEXT a…

---

## [textureSize() - Error Fragment Shader](https://discourse.threejs.org/t/texturesize-error-fragment-shader/16884)

<div class="topic-metadata">

**Author:** [@MrOrangeSky](https://discourse.threejs.org/u/MrOrangeSky)\
**Replies:** 5\
**Last updated:** [July 8, 2020, 10:37am UTC](https://discourse.threejs.org/t/texturesize-error-fragment-shader/16884 "2020-07-08T10:37:46Z")

</div>

I am using inbuilt opengl function - \[ "ivec2 textureSize(\`|gsampler2D sampler, int lod ) " https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/textureSize.xhtml \] to compute the size of texel as follows in my fr…

---

## [WebGL2 Breaking Custom Shader](https://discourse.threejs.org/t/webgl2-breaking-custom-shader/16603)

<div class="topic-metadata">

**Author:** [@titansoftime](https://discourse.threejs.org/u/titansoftime)\
**Replies:** 5\
**Last updated:** [June 28, 2020, 9:16pm UTC](https://discourse.threejs.org/t/webgl2-breaking-custom-shader/16603 "2020-06-28T21:16:59Z")

</div>

So, I’ve been using the SPE particle system for years now. https://github.com/squarefeet/ShaderParticleEngine Unfortunately the author no longer maintains the project. I’ve been able to patch things here and there as th…

---

## [Is there more examples about materials / texture3d / volume for webgl2](https://discourse.threejs.org/t/is-there-more-examples-about-materials-texture3d-volume-for-webgl2/6202)

<div class="topic-metadata">

**Author:** [@zhudongwork](https://discourse.threejs.org/u/zhudongwork)\
**Replies:** 4\
**Last updated:** [June 24, 2020, 8:21pm UTC](https://discourse.threejs.org/t/is-there-more-examples-about-materials-texture3d-volume-for-webgl2/6202 "2020-06-24T20:21:54Z")

</div>

There is only one example of webgl2/materials / texture3d / volume. Is there an example of handling volume data in raw format?

---

## [Logarithmic Depth Buffer and webgl2 shader](https://discourse.threejs.org/t/logarithmic-depth-buffer-and-webgl2-shader/9226)

<div class="topic-metadata">

**Author:** [@Alejandro\_Insua](https://discourse.threejs.org/u/Alejandro_Insua)\
**Replies:** 4\
**Last updated:** [August 28, 2019, 6:12am UTC](https://discourse.threejs.org/t/logarithmic-depth-buffer-and-webgl2-shader/9226 "2019-08-28T06:12:25Z")

</div>

Hi all. Is there anyway to use a webgl2 shader with Logarithmic Depth Buffer support? By now I have been using a workaround setting the near and far camera settings depending on the camera position, but it is not enou…

---

## [Rendering to Texture3D/2DArray z-slice](https://discourse.threejs.org/t/rendering-to-texture3d-2darray-z-slice/7753)

<div class="topic-metadata">

**Author:** [@sciecode](https://discourse.threejs.org/u/sciecode)\
**Replies:** 1\
**Last updated:** [May 27, 2019, 8:03pm UTC](https://discourse.threejs.org/t/rendering-to-texture3d-2darray-z-slice/7753 "2019-05-27T20:03:01Z")

</div>

As of now (r104), three.js doesn’t seem to have a WebGLRenderTarget implementation compatible with DataTexture3D and DataTexture2DArray. Would such an implementation be possible and does it make any sense? The way I und…

---

## [How to get MRT textures from WebGLMultisampleRenderTarget](https://discourse.threejs.org/t/how-to-get-mrt-textures-from-webglmultisamplerendertarget/7046)

<div class="topic-metadata">

**Author:** [@kaa](https://discourse.threejs.org/u/kaa)\
**Replies:** 1\
**Last updated:** [April 12, 2019, 11:38am UTC](https://discourse.threejs.org/t/how-to-get-mrt-textures-from-webglmultisamplerendertarget/7046 "2019-04-12T11:38:27Z")

</div>

Hi! First of all i want to say thank you for the webgl2 implementation in three.js. I try to use webgl2 MRT implementation, wrote simple test glsl 3 fragment shader with 3 output colors : version 300 es precision hig…

---

## [Transform feedback & three.js](https://discourse.threejs.org/t/transform-feedback-three-js/5326)

<div class="topic-metadata">

**Author:** [@Lucas\_Monnin](https://discourse.threejs.org/u/Lucas_Monnin)\
**Replies:** 2\
**Last updated:** [December 12, 2018, 2:34pm UTC](https://discourse.threejs.org/t/transform-feedback-three-js/5326 "2018-12-12T14:34:51Z")

</div>

Hello, I would need the transform feedback feature in my project, and I came across this PR: Can I expect it to be part of three.js anytime soon?

---

## [WebGL: ERROR: unsupported shader version](https://discourse.threejs.org/t/webgl-error-unsupported-shader-version/3973)

<div class="topic-metadata">

**Author:** [@lukas2005](https://discourse.threejs.org/u/lukas2005)\
**Replies:** 8\
**Last updated:** [August 31, 2018, 12:26pm UTC](https://discourse.threejs.org/t/webgl-error-unsupported-shader-version/3973 "2018-08-31T12:26:57Z")

</div>

Hello, i am creating a fragment shader that requires GLSL 3 ES functionality. From some posts on Github it looks like Three.js supports it (WebGL 2) but my console spits out that error. My code: https://codepen.io/luk…

---

## [dFdx and dFdy not found in WebGL2 context](https://discourse.threejs.org/t/dfdx-and-dfdy-not-found-in-webgl2-context/3590)

<div class="topic-metadata">

**Author:** [@Fyrestar](https://discourse.threejs.org/u/Fyrestar)\
**Replies:** 2\
**Last updated:** [July 29, 2018, 7:36pm UTC](https://discourse.threejs.org/t/dfdx-and-dfdy-not-found-in-webgl2-context/3590 "2018-07-29T19:36:52Z")

</div>

This is really a confusing issue, the functions are avialable in WebGL1 with the derivatives extension, but are built-in in WebGL2. According to this example, it also works perfectly fine. The shader code is set for 3.0…
