UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

20 lines (18 loc) 523 B
import {ShaderLib} from 'three'; import {ShaderAssemblerMesh} from './_BaseMesh'; import {MeshPhongMaterial} from 'three'; export class ShaderAssemblerPhong extends ShaderAssemblerMesh { override templateShader() { const template = ShaderLib.phong; return { vertexShader: template.vertexShader, fragmentShader: template.fragmentShader, uniforms: template.uniforms, }; } override createMaterial() { const material = new MeshPhongMaterial(); this._addCustomMaterials(material); return material; } }