How to use babylon-mtoon-material - 1 common examples

To help you get started, we’ve selected a few babylon-mtoon-material examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github virtual-cast / babylon-vrm-loader / src / vrm-material-generator.ts View on Github external
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;
    }

babylon-mtoon-material

Unity MToon Shader WebGL porting with babylon.js

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis

Popular babylon-mtoon-material functions