Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem instantiating MeshLineMaterial in TS #14

Open
Matheos96 opened this issue Jan 26, 2024 · 1 comment
Open

Problem instantiating MeshLineMaterial in TS #14

Matheos96 opened this issue Jan 26, 2024 · 1 comment

Comments

@Matheos96
Copy link

Matheos96 commented Jan 26, 2024

Hi!

We are considering switching to this MeshLine fork as it seems to be the best maintained one of the lot.

I am having a bit trouble getting the package to work though, in particular instantiating the MeshLine Material...

TypeScript is giving me the following error

image

I looked at the demo code and surely I don't need to give ALL properties of the options object??? Earlier we used the https://github.com/pmndrs/meshline fork where the options seen in the screenshot was enough (and sizeAttenuation was a number rather than boolean).

I tried running, despite the warning, but I get the following error in the console

THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false Program Info Log: Vertex shader is not compiled. VERTEX ERROR: 0:155: 'isPerspectiveMatrix

Any ideas what I am doing wrong? Thanks!

@Matheos96
Copy link
Author

Matheos96 commented Jan 30, 2024

The
THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false Program Info Log: Vertex shader is not compiled. VERTEX ERROR: 0:155: 'isPerspectiveMatrix
error should be resolved with the merge of the linked PR (if I am correct).

The Typescript issue was "solved" by simply using the as operator like this... I am not too familiar with TS lol...

new MeshLineMaterial({
            color: new THREE.Color(color), 
            lineWidth: 10,
            sizeAttenuation: false,
            resolution: resolutionReference,
} as THREE.ShaderMaterialParameters & MeshLineMaterial

I don't think the two issues were related. The TS one was a misunderstanding / TS incompitability "issue" whereas the shader thing may actually be something worth fixing as per the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant