king2088 / vue-3d-loader

VueJS and threeJS 3d viewer plugin
https://king2088.github.io/vue-3d-loader-docs
MIT License
223 stars 38 forks source link

设置环境光后模型变黑 #55

Closed CHAUMET closed 1 year ago

CHAUMET commented 1 year ago

vue3: 3.2.13 vue-3d-loader:2.1.5 如题, 模型导入不设置光线的前提下只有特定角度有光,设置环境光后模型黑掉了。

<template>
  <div>
    <vue3dLoader
      filePath="04.gltf"
      :height="850"
      :lights="lights"
      backgroundColor="#ccc"
    />
  </div>
</template>

<script setup>
import { ref } from "vue";
import { vue3dLoader } from "vue-3d-loader";
const lights = ref([
  {
    type: "AmbientLight",
    color: "white",
  },
]);
</script>

image

king2088 commented 1 year ago

设置outputEncodingsRGB即可,详细案例代码,可以参考 https://king2088.github.io/vue-3d-loader-docs/zh/guide/example/set-width-height.html

king2088 commented 1 year ago

超过7天无回应,关闭