# \#shaders

**URL:** https://forum.babylonjs.com/tag/shaders/90.md

[Latest](https://forum.babylonjs.com/latest.md) · [Categories](https://forum.babylonjs.com/categories.md) · [Tags](https://forum.babylonjs.com/tags.md)

---

## [Babylon-thin-instance-outline — outline a single thin-instance (the case HighlightLayer / EdgesRenderer can't)](https://forum.babylonjs.com/t/babylon-thin-instance-outline-outline-a-single-thin-instance-the-case-highlightlayer-edgesrenderer-cant/63794)

<div class="topic-metadata">

**Author:** [@increasinglyHuman](https://forum.babylonjs.com/u/increasinglyHuman)\
**Replies:** 2\
**Last updated:** [July 17, 2026, 2:17pm UTC](https://forum.babylonjs.com/t/babylon-thin-instance-outline-outline-a-single-thin-instance-the-case-highlightlayer-edgesrenderer-cant/63794 "2026-07-17T14:17:10Z")

</div>

The demo for the lib Running inside my alpha game project. I ran into a snag on my project and so i did a thing to resolve it. thought it worth sharing. Thin instances are perfect for high-volume repeated geo…

---

## [environmentBRDF LUT](https://forum.babylonjs.com/t/environmentbrdf-lut/58645)

<div class="topic-metadata">

**Author:** [@KallkaGo](https://forum.babylonjs.com/u/KallkaGo)\
**Replies:** 5\
**Last updated:** [May 27, 2025, 9:11am UTC](https://forum.babylonjs.com/t/environmentbrdf-lut/58645 "2025-05-27T09:11:39Z")

</div>

I noticed that the environmentBRDF lut used by babylonjs is different from the existing papers and materials on the Internet. I checked the documentation of filament and checked each channel of the map on the inspector p…

---

## [Fresnel Effect on PBRMaterial Without Replacing Original Material](https://forum.babylonjs.com/t/fresnel-effect-on-pbrmaterial-without-replacing-original-material/57682)

<div class="topic-metadata">

**Author:** [@DarkHorse](https://forum.babylonjs.com/u/DarkHorse)\
**Replies:** 12\
**Last updated:** [April 11, 2025, 12:43am UTC](https://forum.babylonjs.com/t/fresnel-effect-on-pbrmaterial-without-replacing-original-material/57682 "2025-04-11T00:43:57Z")

</div>

Hey everyone! I’m working on a two-tone colored car model and trying to add a Fresnel effect to give it a more dynamic look. This is the car before applying the effect: This is after i have applied that effect. …

---

## [Heightmap with CDLOD/Quadtree and Geomorphing Demo](https://forum.babylonjs.com/t/heightmap-with-cdlod-quadtree-and-geomorphing-demo/56772)

<div class="topic-metadata">

**Author:** [@bpodwinski](https://forum.babylonjs.com/u/bpodwinski)\
**Replies:** 2\
**Last updated:** [March 25, 2025, 7:59pm UTC](https://forum.babylonjs.com/t/heightmap-with-cdlod-quadtree-and-geomorphing-demo/56772 "2025-03-25T19:59:48Z")

</div>

Hello everyone! I’m primarily a web developer, but I also have some experience with 3D using Three.js. A while ago, I decided to experiment an idea: create a CDLOD (Continuous Distance-Dependent Level of Detail) system …

---

## [How to set the value of a common uniform to several ShaderMaterials in one step?](https://forum.babylonjs.com/t/how-to-set-the-value-of-a-common-uniform-to-several-shadermaterials-in-one-step/54624)

<div class="topic-metadata">

**Author:** [@Khanon](https://forum.babylonjs.com/u/Khanon)\
**Replies:** 6\
**Last updated:** [November 8, 2024, 5:01pm UTC](https://forum.babylonjs.com/t/how-to-set-the-value-of-a-common-uniform-to-several-shadermaterials-in-one-step/54624 "2024-11-08T17:01:42Z")

</div>

Hello, Coming from here: Proper way to animate a texture attached to a mesh? I’m treating to do the whole “play animation” logic of a pseudo-sprite within the shader code (switching texture coordinates of a plane), to …

---

## [ShaderMaterial 再进行序列化存储的时候，出现存储不上的情况](https://forum.babylonjs.com/t/shadermaterial/53248)

<div class="topic-metadata">

**Author:** [@zertaul](https://forum.babylonjs.com/u/zertaul)\
**Replies:** 4\
**Last updated:** [September 10, 2024, 3:32am UTC](https://forum.babylonjs.com/t/shadermaterial/53248 "2024-09-10T03:32:47Z")

</div>

如上文，我自定义的一个 shaderMaterial 再进行本地存储时，需要将场景文件进行序列化处理，结果存储后，本应该有的显示消失了，如果修改了参数后，对应的参数反而回出现 this.\_vector2(e).isArray 不是一个方法的错误。如图 有没有那位大佬遇到过这个问题，是不是再babylonjs里的 materials 里的 metadata 里不能存储东西？

---

## [Ripple ShaderMaterial](https://forum.babylonjs.com/t/ripple-shadermaterial/51963)

<div class="topic-metadata">

**Author:** [@Impurity](https://forum.babylonjs.com/u/Impurity)\
**Replies:** 3\
**Last updated:** [July 9, 2024, 8:37pm UTC](https://forum.babylonjs.com/t/ripple-shadermaterial/51963 "2024-07-09T20:37:09Z")

</div>

I’m trying to replicate this ripple shader on shadertoy in this playground, but for some reason I am unable to. Does anyone see where my problem is? The explanation logic of what I was trying to do is also found here: A…

---

## [Blend 2 textures](https://forum.babylonjs.com/t/blend-2-textures/40203)

<div class="topic-metadata">

**Author:** [@cosmos](https://forum.babylonjs.com/u/cosmos)\
**Replies:** 9\
**Last updated:** [June 20, 2024, 2:42pm UTC](https://forum.babylonjs.com/t/blend-2-textures/40203 "2024-06-20T14:42:26Z")

</div>

I want to blend 2 textures, basically overlay texture 2 on top of texture 1 and only those parts of texture 1 should be visible where texture 2 has black colour or the alpha is 0. I know this can be done using shaders b…

---

## [Pixel filtering shader issue. (SkyMaterial with texture2D)](https://forum.babylonjs.com/t/pixel-filtering-shader-issue-skymaterial-with-texture2d/50842)

<div class="topic-metadata">

**Author:** [@Bumpy](https://forum.babylonjs.com/u/Bumpy)\
**Replies:** 1\
**Last updated:** [May 26, 2024, 9:29pm UTC](https://forum.babylonjs.com/t/pixel-filtering-shader-issue-skymaterial-with-texture2d/50842 "2024-05-26T21:29:00Z")

</div>

Hello everyone! I’m kinda stuck with SkyMaterial shader modification. I want to implement day/night cycle as a night background image use simple texture with .png as source. Here is the part of the shader code (pic1) …

---

## [How can I get really good at using the Node Material Editor?](https://forum.babylonjs.com/t/how-can-i-get-really-good-at-using-the-node-material-editor/49291)

<div class="topic-metadata">

**Author:** [@papajuan](https://forum.babylonjs.com/u/papajuan)\
**Replies:** 9\
**Last updated:** [April 4, 2024, 9:54pm UTC](https://forum.babylonjs.com/t/how-can-i-get-really-good-at-using-the-node-material-editor/49291 "2024-04-04T21:54:25Z")

</div>

The NME is clearly a powerful tool, but it seems like I need to understand how shaders actually work in order to use it properly. I’ve read the docs, have watched several NME tutorials that I could follow along with just…

---

## [NME outline shader](https://forum.babylonjs.com/t/nme-outline-shader/26377)

<div class="topic-metadata">

**Author:** [@TheScientist](https://forum.babylonjs.com/u/TheScientist)\
**Replies:** 22\
**Last updated:** [September 8, 2023, 2:55pm UTC](https://forum.babylonjs.com/t/nme-outline-shader/26377 "2023-09-08T14:55:16Z")

</div>

Does anyone know how to make an actual outline shader in the NME? and also is there anywhere I can learn NME in full besides BabylonJS youtube? I am interested in making awesome shaders but I don’t know much about it(be…

---

## [CustomProceduralTexture + GPUParticleSystem: unstable performance](https://forum.babylonjs.com/t/customproceduraltexture-gpuparticlesystem-unstable-performance/43838)

<div class="topic-metadata">

**Author:** [@ErickPetru](https://forum.babylonjs.com/u/ErickPetru)\
**Replies:** 7\
**Last updated:** [September 6, 2023, 6:47pm UTC](https://forum.babylonjs.com/t/customproceduraltexture-gpuparticlesystem-unstable-performance/43838 "2023-09-06T18:47:16Z")

</div>

I was working on a prototype for a space scene with a CustomProceduralTexture for a skydome, plus some GPUParticleSystem instances for fogs/nebula. The texture is a shader I adjusted using some dot noise 3D layers, and …

---

## [The shader written in GLSL is being painted in yellow instead of displaying a gradient color?](https://forum.babylonjs.com/t/the-shader-written-in-glsl-is-being-painted-in-yellow-instead-of-displaying-a-gradient-color/43024)

<div class="topic-metadata">

**Author:** [@SNM](https://forum.babylonjs.com/u/SNM)\
**Replies:** 4\
**Last updated:** [August 7, 2023, 3:27pm UTC](https://forum.babylonjs.com/t/the-shader-written-in-glsl-is-being-painted-in-yellow-instead-of-displaying-a-gradient-color/43024 "2023-08-07T15:27:42Z")

</div>

The shader is displaying a solid yellow color instead of gradient color for some unknown reason. I even tried the shader in the Babylon Cyos editor (https://cyos.babylonjs.com/), and it still showed the yellow color. Is …

---

## [The fragment shader material doesn't stay with the object when we drag it around?](https://forum.babylonjs.com/t/the-fragment-shader-material-doesnt-stay-with-the-object-when-we-drag-it-around/43041)

<div class="topic-metadata">

**Author:** [@SNM](https://forum.babylonjs.com/u/SNM)\
**Replies:** 2\
**Last updated:** [August 7, 2023, 3:17pm UTC](https://forum.babylonjs.com/t/the-fragment-shader-material-doesnt-stay-with-the-object-when-we-drag-it-around/43041 "2023-08-07T15:17:19Z")

</div>

How can I make the fragment shader material move with the ground/mesh when it is dragged around? Is it because the custom vector shader is configured for world view projection? Or do I need to set this explicitly usin…

---

## [Babylon Native custom shader texture sampler inverted in iOS?](https://forum.babylonjs.com/t/babylon-native-custom-shader-texture-sampler-inverted-in-ios/42776)

<div class="topic-metadata">

**Author:** [@inteja](https://forum.babylonjs.com/u/inteja)\
**Replies:** 5\
**Last updated:** [August 3, 2023, 10:03am UTC](https://forum.babylonjs.com/t/babylon-native-custom-shader-texture-sampler-inverted-in-ios/42776 "2023-08-03T10:03:03Z")

</div>

In our Babylon React Native app I have a shader in a custom material plugin that uses a texture sampler to lookup vertex color, but the vertical texture coordinate seems to get inverted when the app is built for iOS comp…

---

## [Long time for shader compilation from glb file](https://forum.babylonjs.com/t/long-time-for-shader-compilation-from-glb-file/41137)

<div class="topic-metadata">

**Author:** [@Dok11](https://forum.babylonjs.com/u/Dok11)\
**Replies:** 4\
**Last updated:** [May 26, 2023, 12:44pm UTC](https://forum.babylonjs.com/t/long-time-for-shader-compilation-from-glb-file/41137 "2023-05-26T12:44:05Z")

</div>

I use SceneLoader.Append to import my glb file into scene. It contains many meshes with different materials, so their compilation takes a long time — from 1 sec on high end pc, up to 15 sec in Safari. Is it possible to …

---

## [Hook .glsl shader files](https://forum.babylonjs.com/t/hook-glsl-shader-files/39445)

<div class="topic-metadata">

**Author:** [@Guillaume\_Pelletier](https://forum.babylonjs.com/u/Guillaume_Pelletier)\
**Replies:** 12\
**Last updated:** [April 24, 2023, 11:40am UTC](https://forum.babylonjs.com/t/hook-glsl-shader-files/39445 "2023-04-24T11:40:28Z")

</div>

Hello everyone, I am currently working on a TypeScript library that heavily utilizes shaders. To streamline the process, I prefer to write the shaders in separate GLSL files rather than adding them to the JS or script f…

---

## [Creating Shader from NodeMaterialEditor](https://forum.babylonjs.com/t/creating-shader-from-nodematerialeditor/37803)

<div class="topic-metadata">

**Author:** [@ThalerMatthias](https://forum.babylonjs.com/u/ThalerMatthias)\
**Replies:** 7\
**Last updated:** [February 1, 2023, 2:55pm UTC](https://forum.babylonjs.com/t/creating-shader-from-nodematerialeditor/37803 "2023-02-01T14:55:17Z")

</div>

Hi, im trying the following: Exporting Shaders from following NM: Babylon.js Node Material Editor splitting the vertex and fragment shader into two seperate files like said in the docs: customShader.fragment.fx …

---

## [Shader to dynamically recolor select parts of a fully textured mesh?](https://forum.babylonjs.com/t/shader-to-dynamically-recolor-select-parts-of-a-fully-textured-mesh/37689)

<div class="topic-metadata">

**Author:** [@inteja](https://forum.babylonjs.com/u/inteja)\
**Replies:** 3\
**Last updated:** [January 29, 2023, 10:55pm UTC](https://forum.babylonjs.com/t/shader-to-dynamically-recolor-select-parts-of-a-fully-textured-mesh/37689 "2023-01-29T22:55:13Z")

</div>

I’m aware of ID maps in Blender and the mix map in the Babylon.js Terrain Material and multi-materials but none of these are quite what I’m after. I am wondering if there’s something sort of like this in a shader, node m…

---

## [Does this demo work for anyone?](https://forum.babylonjs.com/t/does-this-demo-work-for-anyone/37248)

<div class="topic-metadata">

**Author:** [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Replies:** 2\
**Last updated:** [January 10, 2023, 8:46pm UTC](https://forum.babylonjs.com/t/does-this-demo-work-for-anyone/37248 "2023-01-10T20:46:54Z")

</div>

I came across this article Which links to two pgs, but this one doesn’t work for me: Curious if anyone else has the same issue, here’s the errors:

---

## [Babylon React Native custom ShaderMaterial error on iOS](https://forum.babylonjs.com/t/babylon-react-native-custom-shadermaterial-error-on-ios/31031)

<div class="topic-metadata">

**Author:** [@inteja](https://forum.babylonjs.com/u/inteja)\
**Replies:** 14\
**Last updated:** [December 9, 2022, 9:50am UTC](https://forum.babylonjs.com/t/babylon-react-native-custom-shadermaterial-error-on-ios/31031 "2022-12-09T09:50:46Z")

</div>

@bghgary We have a custom ShaderMaterial in a Babylon React Native project which works fine on Android but fails with the following error on iOS. -\[MTLVertexDescriptorInternal newSerializedDescriptor\], line 726: error '…

---

## [My vertex shader line w = position.x\*position.x always gives me a constant value](https://forum.babylonjs.com/t/my-vertex-shader-line-w-position-x-position-x-always-gives-me-a-constant-value/36306)

<div class="topic-metadata">

**Author:** [@SergioFdo](https://forum.babylonjs.com/u/SergioFdo)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 10:11pm UTC](https://forum.babylonjs.com/t/my-vertex-shader-line-w-position-x-position-x-always-gives-me-a-constant-value/36306 "2022-12-08T22:11:32Z")

</div>

Hi. Please first refer to I was playing with shaders and In a ground mesh on the xz plane, I managed to paint it with a rainbow disk of radius 5. Now, having each point in my ground coordinates (x,0,z), I want to mov…

---

## [Blender to Babylon shader compatibility - what are the differences?](https://forum.babylonjs.com/t/blender-to-babylon-shader-compatibility-what-are-the-differences/33055)

<div class="topic-metadata">

**Author:** [@Chrisor9](https://forum.babylonjs.com/u/Chrisor9)\
**Replies:** 2\
**Last updated:** [August 30, 2022, 12:59am UTC](https://forum.babylonjs.com/t/blender-to-babylon-shader-compatibility-what-are-the-differences/33055 "2022-08-30T00:59:12Z")

</div>

Hi all Babylon & Blender users, I want to know how compatible are the shaders created in Blender with the shaders and materials (including node materials) used in Babylon? Not so much the PBR workflow with its various …

---

## [Improvement ideas regarding CYOS and WebGPU](https://forum.babylonjs.com/t/improvement-ideas-regarding-cyos-and-webgpu/32841)

<div class="topic-metadata">

**Author:** [@pjmlp](https://forum.babylonjs.com/u/pjmlp)\
**Replies:** 2\
**Last updated:** [August 8, 2022, 3:16pm UTC](https://forum.babylonjs.com/t/improvement-ideas-regarding-cyos-and-webgpu/32841 "2022-08-08T15:16:36Z")

</div>

Hi everyone, it seems to be a kind hidden gem that one only finds out when going through all the documentation, yet I find the shaders playground (CYOS), a very nice tool to play with shader coding. There are surely ot…

---

## [Instance Animation via RawTexture3D](https://forum.babylonjs.com/t/instance-animation-via-rawtexture3d/30823)

<div class="topic-metadata">

**Author:** [@ArrayBuffer](https://forum.babylonjs.com/u/ArrayBuffer)\
**Replies:** 2\
**Last updated:** [May 30, 2022, 1:51pm UTC](https://forum.babylonjs.com/t/instance-animation-via-rawtexture3d/30823 "2022-05-30T13:51:33Z")

</div>

Dear babylon.js friends, I am trying to orchestrate per instance animations using a ShaderMaterial and RawTexture3D. The vertex animations and targeted vertices are not always as I would expect. For example, in the fo…
