修复导出的缩略图中带有光源的问题
This commit is contained in:
@@ -36,10 +36,11 @@ export class MaterialRenderer
|
||||
var ambient = new AmbientLight();
|
||||
this.scene.add(ambient);
|
||||
|
||||
//Pontual light
|
||||
var point = new PointLight();
|
||||
point.position.set(-0.5, 1, 1.5);
|
||||
this.scene.add(point);
|
||||
// 这个点光源会导致生成的缩略图上有一个高光
|
||||
// //Pontual light
|
||||
// var point = new PointLight();
|
||||
// point.position.set(-0.5, 1, 1.5);
|
||||
// this.scene.add(point);
|
||||
}
|
||||
|
||||
//Set render size
|
||||
|
@@ -16,6 +16,7 @@
|
||||
<CfFlex gap="1em" v-if="debugMode">
|
||||
<button class="btn-success" style="min-width: 110px;" @click="HandleUpload">保存</button>
|
||||
<button class="btn-danger" style="min-width: 110px;" @click="HandleCancel">取消</button>
|
||||
<button v-if="debugMode" class="btn-primary" style="min-width: 110px;" @click="HandleGenerateLogo">预览缩略图</button>
|
||||
</CfFlex>
|
||||
</div>
|
||||
|
||||
@@ -115,6 +116,7 @@ import { DirectoryId } from "../api/Request";
|
||||
import { IsNullOrWhitespace } from "../helpers/helper.string";
|
||||
import { FromDeflateBase64, ToDeflatedBase64 } from "../helpers/helper.material";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { DownloadFile } from "../helpers/helper.web";
|
||||
|
||||
export interface MaterialRequest {
|
||||
/** 材质名 */
|
||||
@@ -273,6 +275,11 @@ function HandleCancel() {
|
||||
emits('cancel');
|
||||
}
|
||||
|
||||
async function HandleGenerateLogo() {
|
||||
const blob = await scene.GenerateMaterialLogoAsync();
|
||||
DownloadFile("logo.png", blob);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
Upload: HandleUpload,
|
||||
Cancel: HandleCancel
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { computed, ref } from "vue";
|
||||
import { MaterialEditor } from "../common/MaterialEditor";
|
||||
import { Database, ObjectId, PhysicalMaterialRecord, TextureTableRecord } from "webcad_ue4_api";
|
||||
import { Database, PhysicalMaterialRecord, TextureTableRecord } from "webcad_ue4_api";
|
||||
import { LoadImageFromUrl } from "../helpers/helper.imageLoader";
|
||||
import { Texture } from "three";
|
||||
import { materialRenderer } from "../common/MaterialRenderer";
|
||||
|
Reference in New Issue
Block a user