From a1c80c3d279e1ce597109b19b4b70288639e82bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com>
Date: Mon, 1 Jan 2024 14:00:41 -0600
Subject: [PATCH] feat: mesh occlusion base work
---
scripts/buildAssets.ts | 32 ++++++++++++++------------
src/app/tools/tankopedia/[id]/page.tsx | 13 +++++++++++
2 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/scripts/buildAssets.ts b/scripts/buildAssets.ts
index 6372e1245..d233d61bd 100644
--- a/scripts/buildAssets.ts
+++ b/scripts/buildAssets.ts
@@ -1,6 +1,7 @@
import { NodeIO } from '@gltf-transform/core';
import { config } from 'dotenv';
import { readdir, writeFile } from 'fs/promises';
+import { parse } from 'path';
import { argv } from 'process';
import sharp from 'sharp';
import { Vector3Tuple } from 'three';
@@ -107,6 +108,7 @@ interface VehicleDefinitions {
level: number;
yawLimits: string | string[];
gunPosition: string | string[];
+ models: { undamaged: string };
guns: {
[key: string]: {
reloadTime: number;
@@ -216,6 +218,7 @@ if (allTargets || targets?.includes('definitions')) {
const tankTurrets = Object.keys(tankDefinition.root.turrets0).map(
(turretKey) => {
const turret = tankDefinition.root.turrets0[turretKey];
+ console.log(parse(turret.models.undamaged).name);
const turretId = toUniqueId(nation, turretList.root.ids[turretKey]);
const turretYaw = (
typeof turret.yawLimits === 'string'
@@ -344,21 +347,20 @@ if (allTargets || targets?.includes('definitions')) {
);
console.log('Committing tank definitions...');
- writeFile('test.json', JSON.stringify(tankDefinitions));
- await commitMultipleFiles(
- 'tresabhi',
- 'blitzkrieg-assets',
- 'main',
- 'definitions',
- [
- {
- content: JSON.stringify(tankDefinitions),
- encoding: 'utf-8',
- path: 'definitions/tanks.json',
- },
- ],
- true,
- );
+ // await commitMultipleFiles(
+ // 'tresabhi',
+ // 'blitzkrieg-assets',
+ // 'main',
+ // 'definitions',
+ // [
+ // {
+ // content: JSON.stringify(tankDefinitions),
+ // encoding: 'utf-8',
+ // path: 'definitions/tanks.json',
+ // },
+ // ],
+ // true,
+ // );
}
if (
diff --git a/src/app/tools/tankopedia/[id]/page.tsx b/src/app/tools/tankopedia/[id]/page.tsx
index 68c295e33..3b049a442 100644
--- a/src/app/tools/tankopedia/[id]/page.tsx
+++ b/src/app/tools/tankopedia/[id]/page.tsx
@@ -22,6 +22,7 @@ import {
} from '@radix-ui/themes';
import { Environment, OrbitControls } from '@react-three/drei';
import { Canvas, useLoader } from '@react-three/fiber';
+import { EffectComposer, SSAO } from '@react-three/postprocessing';
import { go } from 'fuzzysort';
import { debounce } from 'lodash';
import Link from 'next/link';
@@ -117,6 +118,18 @@ export default function Page({ params }: { params: { id: string } }) {
{/* I really like apartment, dawn, and sunset */}
+
+
+
+