fix: misc map

This commit is contained in:
TrèsAbhi authored and GitHub committed 2024-02-02 09:46:24 -06:00
1 parent 89d4cadb61
commit 0251bfc842
1 file changed
+9 -9
+9 -9
View File
@@ -1,9 +1,9 @@
import { existsSync } from 'fs'; import { existsSync } from "fs";
import sharp from 'sharp'; import sharp from "sharp";
import { Vector3Tuple } from 'three'; import { Vector3Tuple } from "three";
import { readDVPLFile } from '../blitz/readDVPLFile'; import { readDVPLFile } from "../blitz/readDVPLFile";
import { DdsStream } from '../streams/dds'; import { DdsStream } from "../streams/dds";
import { PvrStream } from '../streams/pvr'; import { PvrStream } from "../streams/pvr";
export enum TextureMutation { export enum TextureMutation {
Normal, Normal,
@@ -28,11 +28,11 @@ type ReadTextureOptions =
}; };
export async function readTexture(path: string, options?: ReadTextureOptions) { export async function readTexture(path: string, options?: ReadTextureOptions) {
const ddsTexturePath = path.replace('.tex', '.dx11.dds.dvpl'); const ddsTexturePath = path.replace(".tex", ".dx11.dds.dvpl");
const isDds = existsSync(ddsTexturePath); const isDds = existsSync(ddsTexturePath);
const resolvedTexturePath = isDds const resolvedTexturePath = isDds
? ddsTexturePath ? ddsTexturePath
: ddsTexturePath.replace('.dds', '.pvr'); : ddsTexturePath.replace(".dds", ".pvr");
const decompressedDvpl = await readDVPLFile(resolvedTexturePath); const decompressedDvpl = await readDVPLFile(resolvedTexturePath);
const raw = isDds const raw = isDds
@@ -78,7 +78,7 @@ export async function readTexture(path: string, options?: ReadTextureOptions) {
break; break;
} }
case TextureMutation.RoughnessMetallicness: { case TextureMutation.Miscellaneous: {
for (let index = 0; index < channels; index += 4) { for (let index = 0; index < channels; index += 4) {
/** /**
* Green is ambient occlusion and alpha is emissive. But very few tanks * Green is ambient occlusion and alpha is emissive. But very few tanks