Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问clear审计提醒

graphics-troubleshooting图形故障排除

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

272

周安装

11

GitHub Stars

3

下载量

85
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:graphics-troubleshooting(图形故障排除)
来源仓库:https://github.com/anthemflynn/ccmp
仓库路径:skills/graphics-troubleshooting
安装命令:
npx skills add https://github.com/anthemflynn/ccmp --skill graphics-troubleshooting
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/anthemflynn/ccmp --skill graphics-troubleshooting

简介

用于辅助前端页面、组件和样式开发,适合生成或审查 React、Vue 等相关代码。

  • 适用于组件结构整理、布局问题定位和性能优化的场景。
  • 使用时需结合项目现有设计系统、路由和构建方式,避免生成孤立片段。
  • 涉及页面改动时应配合本地预览和构建检查确认视觉效果。
  • 通过 GitHub 安装,支持 Codex、Claude、Cursor 和 Gemini CLI 等宿主环境。

SKILL.md

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

Related Skills

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

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.96%
按下载量换算24

windsurf

21.8%
按下载量换算19

OpenCode

17.72%
按下载量换算15

Codex

11.4%
按下载量换算10

Antigravity

7.42%
按下载量换算6

Gemini CLI

3.31%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills