mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
feat: baked ao
This commit is contained in:
1 parent
335cd4d699
commit
66cf1fd223
11 files changed
+75
-93
No files matched your search
@@ -12,7 +12,6 @@ import { dirname } from "path";
|
||||
import { readBaseColor } from "../readBaseColor";
|
||||
import { readDVPLFile } from "../readDVPLFile";
|
||||
import { readNormal } from "../readNormal";
|
||||
import { readOcclusion } from "../readOcclusion";
|
||||
import { readRoughnessMetallic } from "../readRoughnessMetallic";
|
||||
import {
|
||||
vertexAttributeGLTFName,
|
||||
@@ -70,7 +69,10 @@ export async function extractModel(data: string, path: string) {
|
||||
.setMimeType("image/jpeg")
|
||||
.setImage(
|
||||
await readBaseColor(
|
||||
`${data}/3d/${dirname(path)}/${textures.baseColorMap ?? textures.albedo}`
|
||||
`${data}/3d/${dirname(path)}/${textures.baseColorMap ?? textures.albedo}`,
|
||||
textures.miscMap
|
||||
? `${data}/3d/${dirname(path)}/${textures.miscMap}`
|
||||
: undefined
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -88,19 +90,6 @@ export async function extractModel(data: string, path: string) {
|
||||
);
|
||||
}
|
||||
|
||||
if (textures.miscMap) {
|
||||
material.setOcclusionTexture(
|
||||
document
|
||||
.createTexture(node.materialName)
|
||||
.setMimeType("image/jpeg")
|
||||
.setImage(
|
||||
await readOcclusion(
|
||||
`${data}/3d/${dirname(path)}/${textures.miscMap}`
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (textures.baseNormalMap ?? textures.normalmap) {
|
||||
const isBase = textures.baseNormalMap !== undefined;
|
||||
|
||||
@@ -236,10 +225,6 @@ export async function extractModel(data: string, path: string) {
|
||||
.setBuffer(buffer);
|
||||
|
||||
primitive.setAttribute(name, attributeAccessor);
|
||||
|
||||
if (attribute === VertexAttribute.TEXCOORD0) {
|
||||
primitive.setAttribute("TEXCOORD_2", attributeAccessor);
|
||||
}
|
||||
});
|
||||
|
||||
const mesh = document
|
||||
|
||||
Reference in new issue
Block a user