threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112
  1. import {MeshPhysicalMaterial} from 'threepipe'
  2. // todo see blender gltf exporter and convert to js. structure is the same
  3. export function createMaterial(mat: any) {
  4. const material = new MeshPhysicalMaterial()
  5. material.color.setRGB(mat.r, mat.g, mat.b)
  6. material.roughness = mat.roughness !== undefined ? mat.roughness : 0.4
  7. material.metalness = mat.metallic !== undefined ? mat.metallic : 0.0
  8. material.opacity = mat.alpha !== undefined ? mat.alpha : 0.0
  9. material.transparent = material.opacity < 1.0
  10. return material
  11. }