polygonjs-engine
Version:
node-based webgl 3D engine https://polygonjs.com
26 lines (25 loc) • 964 B
JavaScript
import {UniformsUtils as UniformsUtils2} from "three/src/renderers/shaders/UniformsUtils";
import {ShaderMaterial as ShaderMaterial2} from "three/src/materials/ShaderMaterial";
import {ShaderLib as ShaderLib2} from "three/src/renderers/shaders/ShaderLib";
import {ShaderAssemblerMesh} from "./_BaseMesh";
export class ShaderAssemblerBasic extends ShaderAssemblerMesh {
get _template_shader() {
const template = ShaderLib2.basic;
return {
vertexShader: template.vertexShader,
fragmentShader: template.fragmentShader,
uniforms: template.uniforms
};
}
create_material() {
const template_shader = this._template_shader;
const material = new ShaderMaterial2({
lights: false,
uniforms: UniformsUtils2.clone(template_shader.uniforms),
vertexShader: template_shader.vertexShader,
fragmentShader: template_shader.fragmentShader
});
this._add_custom_materials(material);
return material;
}
}