You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.
export class JourneySphereMaterial extends LayerMaterial {
constructor() {
super({
color: 'white',
lighting: 'physical',
transmission: 1,
// @ts-ignore
thickness: 0,
roughness: 0.42,
metalness: 0.19,
});
//Transmission only works if this is set, should work in init properties too?
this.transmission = 1;
}
}
However some properties like thickness gives a typescript error, and transmission isn't even set on the material created. I have to set it manually with that last line in the example for it to take effect.
The text was updated successfully, but these errors were encountered:
About the types, the MeshPhysicalMaterialParameters type from @types/three seems to not have thickness as a property, the only option is to open an issue in ThreeJS and use ts-ignore
Also, LayerMaterial and all derived classes are of type Material and will give you type errors if you try to do LayerMaterial.transmission for example. This is because transmission is a property on the MeshPhysicalMaterial class and not on the base Material class. Only option here is to cast your material to MeshPhysicalMaterial
I'm making a new material like this:
However some properties like thickness gives a typescript error, and transmission isn't even set on the material created. I have to set it manually with that last line in the example for it to take effect.
The text was updated successfully, but these errors were encountered: