Noise on mesh when moving THREE.MeshLine to BJS

PG: https://playground.babylonjs.com/#W0NG5F#2.
threejs meshline: THREE.MeshLine/THREE.MeshLine.js at master · spite/THREE.MeshLine · GitHub
Sorry that I can’t make the problem clearly. I’m trying to move meshline from threejs to BJS but I find there are lots of noise on mesh, it is even all black at first. You can see the noise by moving the camera.
I recognize that things are better on winding part (by commenting line 191 and uncommenting line 190), so I guess maybe that there is something I didn’t know about rendering.

Adding @nasimiasl as I have no idea about the custom material.

I am pretty sure the normals would be the issue as they are not passed into the fragment.

4 Likes

It should be! Now it works fine. Thank you so much!
https://playground.babylonjs.com/#W0NG5F#3

----- update -----
https://playground.babylonjs.com/#W0NG5F#5
vNormal should be vec3(0, 1, 0);

4 Likes

Nice work!!!

1 Like

hey worldViewProjection is exist in PBR Custom Material

@tanpopo It is kind of a cool feature, I wonder how we could add this in standard ?

It seems not. I didn’t recognize this until there is nothing without set worldViewProjection. You can try to comment line 168 and the mesh disappear, but there is possibility I did something wrong.

Of course! Is there anything that I need to do?

This would require to not use custom material but being supported in standard but I wonder how hard it could be to pull it ?

I think it can be a class extends PBRMaterial, kind of being like PBRCustomMaterial, but with its own shader? Or do you just mean a material in materialsLibrary?
Anyway I’m willing to have a try though I’m not sure if I’m able to accomplish this.

no problem we could definitely help and discuss on the PR :slight_smile: