# Exception if material parameter set on LinesMesh

**URL:** <https://forum.babylonjs.com/t/exception-if-material-parameter-set-on-linesmesh/34769>\
**Category:** Bugs\
**Tags:** material\
**Created:** [October 13, 2022, 10:21am UTC](https://forum.babylonjs.com/t/exception-if-material-parameter-set-on-linesmesh/34769 "2022-10-13T10:21:47Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 15, 2022, 6:30pm UTC](https://forum.babylonjs.com/t/exception-if-material-parameter-set-on-linesmesh/34769/11 "2022-10-15T18:30:58Z")

</div>

Thanks for the repro!

This PR will fix the problem:

> <https://github.com/BabylonJS/Babylon.js/pull/13116>
>
> See https://forum.babylonjs.com/t/exception-if-material-parameter-set-on-linesme…sh/34769/8
> 
> It's actually a problem of the \`isReady\` function being called for the wrong material when testing for material readyness in a RTT.
> 
> It was normally already handled by #11696, but the \`mesh.isReady(false)\` call I added at the start of the \`customIsReadyFunction\` implementation can end up calling a \`isReady\` function for the wrong material if the \`Mesh.isReady\` function is overriden, which is what \`LineMesh\` is doing: 
> 
> \`\`\`typescript
> public isReady() {
> if (!this.\_lineMaterial.isReady(this, !!this.\_userInstancedBuffersStorage)) {
> return false;
> }
> 
> return super.isReady();
> }
> \`\`\`

Note that even with the fix you will see some flickering and/or different colors for the shading of the lines: that’s because the standard material is applying lighting. You probably want to use the emissive color for the line color and disable lighting, as in:

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

---

_[View the full topic](https://forum.babylonjs.com/t/exception-if-material-parameter-set-on-linesmesh/34769)._
