mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
fix: misc map
This commit is contained in:
1 parent
89d4cadb61
commit
0251bfc842
1 file changed
+9
-9
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user