# GreasedLine.setPoints broken?

**URL:** <https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033>\
**Category:** Bugs\
**Tags:** greasedline\
**Created:** [November 28, 2024, 8:28am UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033 "2024-11-28T08:28:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [November 28, 2024, 8:28am UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033/1 "2024-11-28T08:28:50Z")

</div>

Hello 🙂

Coming back to my [wire physics project](https://forum.babylonjs.com/t/custom-wire-physics-using-greasedlines/54314/1) I noticed that the lines between points won’t render :

> **[Babylon.js Playground](https://playground.babylonjs.com/#4U4QH9%23129)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

* * *

After a quick investigation, it appears it comes from `GreasedLine.setPoints` method.  
Here is a minimalist PG to reproduce :

> **[Babylon.js Playground](https://playground.babylonjs.com/#H1LRZ3%23668)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

(Comment line 28 and the GreasedLine is back)

* * *

@roland, a recent commit must have changed something in the last days/weeks

---

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [November 28, 2024, 9:37am UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033/2 "2024-11-28T09:37:43Z")

</div>

I’m seeing a growing square in the second link. And lines between balls on the first link. (Babylon Version 7.36.0 using WebGL2).

It looks correct to me. Am I missing something?

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [November 28, 2024, 12:54pm UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033/3 "2024-11-28T12:54:17Z")

</div>

> [@HiGreg](#):
>
> I’m seeing a growing square in the second link. And lines between balls on the first link. (Babylon Version 7.36.0 using WebGL2)

Are you ? 🤔 Then it might me hardware or OS related. On first link I have no gray lines, on second link I have blank render without any square…

 ![Screenshot from 2024-11-28 13-54-43](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/d/cd9d67c0e8cd414bef20b79e803051f5b235ebbe.png)

* * *

- BabylonJS 7.36.0 WebGL2
- Ubuntu 22.04
- Google Chrome Version 131.0.6778.85 (Official Build) (64-bit)

* * *

`EDIT` : With WebGPU it works, but slow as hell 🤔 . With WebGL2, no GreasedLine after `setPoints` call …

---

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [November 28, 2024, 2:10pm UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033/4 "2024-11-28T14:10:03Z")

</div>

WebGPU works for me and is slow for me also.

And yes, WebGL2 and WebGL both work for me, display lines, and are faster. I think GreasedLine support with WebGPU is in progress.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 28, 2024, 8:23pm UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033/5 "2024-11-28T20:23:38Z")

</div>

Looks like it might be related to parallel shader compilation [https://playground.babylonjs.com/#H1LRZ3#669](https://playground.babylonjs.com/#H1LRZ3#669)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 28, 2024, 8:43pm UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033/6 "2024-11-28T20:43:36Z")

</div>

What is happening is that the shader is deleted/created everyframe cause setIndices will end up recreating subMeshes which are the one holding the shader.

I will work on it with @Evgeni_Popov tomorrow and probably @Deltakosh on Monday.

Sorry for the inconvenience.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 29, 2024, 12:18am UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033/7 "2024-11-29T00:18:07Z")

</div>

On it!

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 29, 2024, 12:18am UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033/8 "2024-11-29T00:18:31Z")

</div>

[Fix disposing of effects for submeshes by deltakosh · Pull Request #15910 · BabylonJS/Babylon.js](https://github.com/BabylonJS/Babylon.js/pull/15910)

---

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [November 29, 2024, 2:10am UTC](https://forum.babylonjs.com/t/greasedline-setpoints-broken/55033/9 "2024-11-29T02:10:00Z")

</div>

Just testing newly-enabled webm upload.
