Back to list
AnthemFlynn

graphics-troubleshooting

by AnthemFlynn

Anthem's Claude Code Marketplace - A curated collection of skills and plugins for Claude Code

1🍴 0📅 Jan 5, 2026

SKILL.md


name: graphics-troubleshooting description: Debug and fix common issues in Three.js, React Three Fiber, and 3D asset pipelines. Use when encountering visual bugs, performance problems, loading failures, or unexpected behavior. Covers black screens, Z-fighting, memory leaks, shader errors, and physics glitches.

Graphics Troubleshooting

Diagnose and fix 3D web graphics issues fast. Organized by symptom (what you see) for rapid diagnosis.

Library Versions (2026)

  • Three.js: r171+
  • React Three Fiber: v9.5+
  • @react-three/drei: v9.116+
  • @react-three/rapier: v2+

Quick Diagnosis

Nothing Renders (Black/Empty Screen)

CheckCommand/Action
Camera positionIs camera inside object? Move to [0, 0, 5]
Camera targetIs camera looking at scene? Check lookAt
Object scaleIs object too small/large? Check scale isn't 0
LightsAre there any lights? Add <ambientLight />
MaterialUsing MeshStandardMaterial without lights?
Render loopIs animate() being called?
Canvas sizeIs container height 0? Check CSS
WebGPU supportBrowser support? Check console for errors

R3F Minimum Visible Scene:

<Canvas>
  <ambientLight intensity={0.5} />
  <directionalLight position={[5, 5, 5]} />
  <mesh position={[0, 0, 0]}>
    <boxGeometry />
    <meshStandardMaterial color="red" />
  </mesh>
</Canvas>

Vanilla Three.js Minimum Scene:

import * as THREE from 'three/webgpu'

const scene = new THREE.Scene()
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000)
camera.position.z = 5

const renderer = new THREE.WebGPURenderer({ antialias: true })
await renderer.init()
renderer.setSize(window.innerWidth, window.innerHeight)
document.body.appendChild(renderer.domElement)

// Add light - required for Standard materials
scene.add(new THREE.AmbientLight(0xffffff, 0.5))
scene.add(new THREE.DirectionalLight(0xffffff, 1))

// Add visible object
const mesh = new THREE.Mesh(
  new THREE.BoxGeometry(),
  new THREE.MeshStandardMaterial({ color: 'red' })
)
scene.add(mesh)

function animate() {
  renderer.render(scene, camera)
}
renderer.setAnimationLoop(animate)

Object Renders But Looks Wrong

SymptomCauseFix
All blackNo lightsAdd ambient + directional light
Flickering facesZ-fightingIncrease camera near, offset overlapping geometry
Inside-outInverted normalsmaterial.side = THREE.DoubleSide or fix in Blender
Pixelated edgesLow DPRrenderer.setPixelRatio(Math.min(devicePixelRatio, 2))
Washed out colorsNo tone mappingrenderer.toneMapping = THREE.ACESFilmicToneMapping
Colors look wrongColor spacerenderer.outputColorSpace = THREE.SRGBColorSpace
Texture blurryFilteringtexture.minFilter = THREE.LinearMipmapLinearFilter
Texture stretchedWrong UVsCheck UV mapping in Blender, use texture.repeat

Performance Issues

SymptomDiagnosisTargetFix
Low FPS (<30)Check renderer.info.render.calls<100 draw callsUse InstancedMesh, merge geometries
Stuttering/hitchingGC pausesAvoid allocationsObject pooling, reuse Vector3s
Memory growingCheck renderer.info.memoryStableCall .dispose() on removal
Slow initial loadLarge assets<5MB totalCompress with Meshopt, resize textures
Slow on mobileToo many triangles<100KSimplify geometry, use LOD

Quick Performance Check:

// Add to console or scene
console.log('Draw calls:', renderer.info.render.calls)
console.log('Triangles:', renderer.info.render.triangles)
console.log('Geometries:', renderer.info.memory.geometries)
console.log('Textures:', renderer.info.memory.textures)

See references/performance.md for detailed profiling.

Loading Failures

ErrorCauseFix
404 Not FoundWrong pathCheck file exists, use absolute path from public
CORS errorCross-originServe from same origin or configure CORS headers
"Unexpected token"Wrong file formatEnsure file is valid GLTF/GLB
Draco decode errorMissing decoderSet dracoLoader.setDecoderPath('/draco/')
KTX2 decode errorMissing transcoderSet ktx2Loader.setTranscoderPath('/basis/')
"Invalid glTF"Corrupted fileValidate at https://gltf.report
Model invisibleWrong scaleCheck scale (Blender default: 1 unit = 1 meter)

Loader Setup Pattern:

import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js'
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js'
import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js'

const loader = new GLTFLoader()

// Draco (for Draco-compressed models)
const dracoLoader = new DRACOLoader()
dracoLoader.setDecoderPath('https://www.gstatic.com/draco/versioned/decoders/1.5.6/')
loader.setDRACOLoader(dracoLoader)

// Meshopt (for Meshopt-compressed models)
loader.setMeshoptDecoder(MeshoptDecoder)

// KTX2 (for Basis Universal textures)
const ktx2Loader = new KTX2Loader()
ktx2Loader.setTranscoderPath('https://cdn.jsdelivr.net/npm/three@0.171.0/examples/jsm/libs/basis/')
ktx2Loader.detectSupport(renderer)
loader.setKTX2Loader(ktx2Loader)

See references/loading.md for more patterns.

Physics Issues (@react-three/rapier)

SymptomCauseFix
Objects fall through floorMissing colliderAdd <RigidBody type="fixed"> to ground
Objects stuck in airWrong body typeUse type="dynamic" for moving objects
Jittery movementHigh velocity + low massIncrease mass or reduce forces
Tunneling (fast objects pass through)CCD disabledEnable ccd={true} on fast bodies
Collider wrong shapeAuto-collider mismatchUse explicit <CuboidCollider> etc.
Physics not updatingWrong loopCheck updateLoop prop on <Physics>

Minimum Physics Setup:

import { Physics, RigidBody } from '@react-three/rapier'

<Physics gravity={[0, -9.81, 0]} debug>
  {/* Ground - fixed, doesn't move */}
  <RigidBody type="fixed">
    <mesh position={[0, -1, 0]}>
      <boxGeometry args={[10, 0.5, 10]} />
      <meshStandardMaterial />
    </mesh>
  </RigidBody>

  {/* Falling object - dynamic */}
  <RigidBody type="dynamic">
    <mesh>
      <sphereGeometry />
      <meshStandardMaterial />
    </mesh>
  </RigidBody>
</Physics>

Shader/Material Errors

ErrorCauseFix
"X is not defined" in shaderMissing uniform/varyingDeclare all variables
Black materialShader compile errorCheck console for GLSL/WGSL errors
Material not updatingMissing needsUpdateSet material.needsUpdate = true
TSL errorWrong importUse import { x } from 'three/tsl'
NodeMaterial blackMissing colorNodeSet material.colorNode = ...

TSL Debug Pattern:

import { color, uniform } from 'three/tsl'

// Start simple, add complexity
const material = new THREE.MeshBasicNodeMaterial()
material.colorNode = color(0xff0000) // Should be red

// If this works, add your custom logic incrementally
When you need...Use skill
Optimize assets before loadingasset-pipeline-3d
Build scenes with vanilla Three.jsthreejs
Build scenes with Reactreact-three-fiber

Reference Files

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon