Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private createMaterialByShader(
context: string,
material: IMaterial,
babylonDrawMode: number,
prop: IVRMMaterialProperty,
): Nullable {
if (prop.shader === IVRMMaterialPropertyShader.VRMMToon) {
const mtoonMaterial = new MToonMaterial(
material.name || `MToonMaterial${material.index}`,
this.loader.babylonScene,
);
this.setMToonMaterialProperties(mtoonMaterial, prop);
return mtoonMaterial;
}
if (prop.shader === IVRMMaterialPropertyShader.VRMUnlitTransparentZWrite) {
const mat = this.loader.createMaterial(context, material, babylonDrawMode);
// 通常マテリアルに Depth Write を強制
mat.disableDepthWrite = false;
mat.forceDepthWrite = true;
return mat;
}
return null;
}