mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-27 04:29:50 +01:00
feat: culling
This commit is contained in:
1 parent
b950ac1318
commit
4d13803b0c
1 file changed
+20
-2
@@ -75,9 +75,26 @@ export async function extractModel(vfs: AbstractVFS, path: string) {
|
|||||||
.setImage(baseColor),
|
.setImage(baseColor),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const defaultConfigArchive =
|
||||||
|
typeof node.configCount === "number"
|
||||||
|
? (times(
|
||||||
|
node.configCount,
|
||||||
|
(index) => node[`configArchive_${index}`],
|
||||||
|
).find((archive) => archive.configName === "Default") ??
|
||||||
|
node.configArchive_0)
|
||||||
|
: undefined;
|
||||||
|
const customCullMode =
|
||||||
|
node.customCullMode ?? defaultConfigArchive?.customCullMode;
|
||||||
|
|
||||||
|
if (customCullMode === 0) {
|
||||||
|
material.setDoubleSided(true);
|
||||||
|
} else if (customCullMode !== undefined) {
|
||||||
|
material.setDoubleSided(false);
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
node.enabledPresets?.AlphaTest &&
|
node.enabledPresets?.AlphaTest &&
|
||||||
node.properties.alphatestThreshold
|
node.properties?.alphatestThreshold
|
||||||
) {
|
) {
|
||||||
const view = new DataView(node.properties.alphatestThreshold);
|
const view = new DataView(node.properties.alphatestThreshold);
|
||||||
const alphaCutoff =
|
const alphaCutoff =
|
||||||
@@ -98,7 +115,8 @@ export async function extractModel(vfs: AbstractVFS, path: string) {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
archive.configName !== "Default" ||
|
archive.configName !== "Default" ||
|
||||||
!archive.enabledPresets?.AlphaTest
|
!archive.enabledPresets?.AlphaTest ||
|
||||||
|
!archive.properties?.alphatestThreshold
|
||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user