point to textures

This commit is contained in:
tresabhi committed 2026-06-08 20:24:51 -05:00
1 parent c86b269cf2
commit f790d07ed6
2 files changed
+12 -9

No files matched your search

+1 -1
View File
@@ -81,7 +81,7 @@ public class MonoGltf
{
var texture = parameterTexture.Value;
var name = Path.GetFileNameWithoutExtension(texture.GetPathName());
var path = $"textures/{name}.webp";
var path = $"../../textures/{name}.webp";
materialBuilder.WithChannelImage(channel, stubTexture);
materialBuilder.GetChannel(channel).Texture.PrimaryImage.Name = path;
@@ -1,5 +1,5 @@
import { OrbitControls } from "@react-three/drei";
import { useLoader } from "@react-three/fiber";
import { Canvas, useLoader } from "@react-three/fiber";
import { GLTFLoader } from "three-stdlib";
import styles from "./index.module.css";
@@ -7,21 +7,24 @@ export function TankopediaSandbox() {
return (
<div className={styles.wrapper}>
<div className={styles.sandbox}>
{/*<Canvas
scene={{ fog: new FogExp2("black", 0.05) }}
<Canvas
// scene={{ fog: new FogExp2("black", 0.05) }}
shadows
className={styles.canvas}
frameloop="demand"
>
{!import.meta.env.SSR && <Content />}
</Canvas>*/}
</Canvas>
</div>
</div>
);
}
function Content() {
const gltf = useLoader(GLTFLoader, "/amogos.glb");
const gltf = useLoader(
GLTFLoader,
"/models/tanks/TankEntity.A128_Concept_1b/hull.glb",
);
gltf.scene.traverse((child) => {
child.castShadow = true;
@@ -29,12 +32,12 @@ function Content() {
return (
<>
<group scale={4}>
<group>
<primitive object={gltf.scene} />
</group>
<ambientLight />
<pointLight castShadow position={[3, 10, 5]} intensity={1000} />
<pointLight castShadow position={[3, 10, 5]} intensity={2 ** 14} />
<ambientLight intensity={1} />
<mesh receiveShadow position={[0, -1, 0]} rotation={[-Math.PI / 2, 0, 0]}>
<planeGeometry args={[2 ** 8, 2 ** 8]} />