jsketcher/modules/scene/materials.js
2022-08-10 01:42:18 -07:00

22 lines
No EOL
526 B
JavaScript

import DPR from 'dpr';
import {MeshPhongMaterial, LineBasicMaterial, FaceColors, DoubleSide} from 'three';
export function createTransparentPhongMaterial(color, opacity) {
return new MeshPhongMaterial({
// vertexColors: FaceColors,
color,
transparent: true,
opacity: opacity,
shininess: 0,
depthWrite: false,
depthTest: false,
side : DoubleSide
});
}
export function createLineMaterial(color, linewidth) {
return new LineBasicMaterial({
color,
linewidth: linewidth / DPR
});
}