Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/rendering/UnitRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ import { CullingService, EntityCategory } from './services/CullingService';
import { LODConfig } from './compute/UnifiedCullingCompute';
import { GPUIndirectRenderer } from './compute/GPUIndirectRenderer';

// Unit geometry cloning - doesn't force recompute normals (units have good normals)
function cloneGeometryForGPUUnit(source: THREE.BufferGeometry): THREE.BufferGeometry {
return cloneGeometryForGPU(source, { recomputeNormals: false });
}

// Instance data for a single unit type + player combo at a specific LOD level
interface InstancedUnitGroup {
mesh: THREE.InstancedMesh;
Expand Down Expand Up @@ -716,7 +711,8 @@ export class UnitRenderer {
// Clone geometry with proper GPU buffer initialization.
// This avoids sharing disposal lifecycle with asset cache and
// ensures required attributes (UVs) exist for WebGPU shaders.
geometry = cloneGeometryForGPU(child.geometry);
// Units have proper normals, so don't recompute them.
geometry = cloneGeometryForGPU(child.geometry, { recomputeNormals: false });
material = child.material;
// Get the mesh's world position Y - this is lost when extracting geometry
const worldPos = new THREE.Vector3();
Expand Down
4 changes: 0 additions & 4 deletions src/rendering/effects/AdvancedParticleSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@ import { MeshBasicNodeMaterial } from 'three/webgpu';
import {
Fn,
vec4,
vec3,
float,
uniform,
uv,
texture,
clamp,
mix,
viewportCoordinate,
instanceIndex,
storage,
instancedBufferAttribute,
} from 'three/tsl';

Expand Down
6 changes: 0 additions & 6 deletions src/rendering/tsl/effects/EffectPasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
vec3,
vec4,
float,
int,
Fn,
mix,
smoothstep,
Expand All @@ -43,11 +42,6 @@ import {
min,
max,
texture,
normalize,
exp,
Loop,
If,
Break,
} from 'three/tsl';

// WebGPU post-processing nodes from addons
Expand Down
Loading