Communitygithub.com

SamuelChien/mega-skills-collection

3D游戏开发原理:渲染、着色器、物理、摄像机等核心系统。

mega-skills-collection 是什么?

此技能提供了3D游戏开发的系统性知识,涵盖渲染管线、着色器原理、3D物理、摄像机系统、光照技术和LOD(细节层次)等核心模块。它详细介绍了每个模块的关键技术与优化策略,例如通过视锥体剔除、遮挡剔除和LOD减少渲染开销,以及使用简单碰撞体搭配复杂视觉模型来优化物理性能。技能适用于Unreal Engine、Unity等主流引擎的游戏开发任务,帮助开发者快速掌握3D游戏系统的基础架构与最佳实践。同时也指出了常见反模式,避免性能陷阱。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/SamuelChien/mega-skills-collection/tree/HEAD/3d-games

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

3D游戏开发

3D游戏系统原理。


1. 渲染管线

阶段

1. 顶点处理 → 变换几何体
2. 光栅化 → 转换为像素
3. 片元处理 → 为像素着色
4. 输出 → 到屏幕

优化原则

技术目的
视锥体剔除不渲染屏幕外内容
遮挡剔除不渲染被遮挡内容
LOD远处降低细节
批处理合并绘制调用

2. 着色器原理

着色器类型

类型用途
顶点着色器位置、法线
片元/像素着色器颜色、光照
计算着色器通用计算

何时编写自定义着色器

  • 特殊效果(水、火焰、传送门)
  • 风格化渲染(卡通、素描)
  • 性能优化
  • 独特视觉标识

3. 3D物理

碰撞形状

形状使用场景
盒子建筑、箱子
球体球类、快速检测
胶囊体角色
网格地形(开销大)

原则

  • 简单碰撞体,复杂视觉
  • 基于层的过滤
  • 射线检测用于视线判断

4. 摄像机系统

摄像机类型

类型用途
第三人称动作、冒险
第一人称沉浸式、FPS
等距视角策略、RPG
轨道摄像机检查、编辑器

摄像机手感

  • 平滑跟随(lerp)
  • 碰撞避免
  • 运动预判
  • 随速度改变视场角

5. 光照

光照类型

类型用途
方向光太阳、月亮
点光源灯、火把
聚光灯手电、舞台
环境光基础照明

性能考虑

  • 实时阴影开销大
  • 尽可能烘焙
  • 大世界使用阴影级联

6. 细节层次(LOD)

LOD策略

距离模型
近处完整细节
中等50% 三角形
远处25% 或公告板

7. 反模式

❌ 不要做✅ 应该做
到处使用网格碰撞体使用简单形状
移动设备上使用实时阴影使用烘焙或模糊阴影
所有距离使用同一LOD基于距离的LOD
未优化的着色器分析并简化

记住: 3D 是制造幻觉。创造出细节的印象,而非细节本身。

何时使用

此技能适用于执行概述中描述的工作流或操作。

限制

  • 仅当任务明确匹配上述范围时使用此技能。
  • 请勿将输出视为环境特定验证、测试或专家审查的替代品。
  • 如果缺少必需的输入、权限、安全边界或成功标准,请暂停并请求澄清。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

SamuelChien/mega-skills-collection

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

SamuelChien/mega-skills-collection

Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.

SamuelChien/mega-skills-collection

Ingeniero de Sistemas de Andru.ia. Diseña, redacta y despliega nuevas habilidades (skills) dentro del repositorio siguiendo el Estándar de Diamante.

SamuelChien/mega-skills-collection

Estratega de Inteligencia de Dominio de Andru.ia. Analiza el nicho específico de un proyecto para inyectar conocimientos, regulaciones y estándares únicos del sector. Actívalo tras definir el nicho.

SamuelChien/mega-skills-collection

2D game development principles. Sprites, tilemaps, physics, camera.

SamuelChien/mega-skills-collection

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

SamuelChien/mega-skills-collection

Accessibility audit skill for scanning, fixing, and verifying WCAG 2.2 Level A and AA compliance across React, Next.js, Vue, Angular, Svelte, and plain HTML codebases. Use when auditing accessibility, fixing a11y violations, checking color contrast, generating compliance reports, or integrating accessibility checks into CI/CD pipelines.

SamuelChien/mega-skills-collection

Ab Test Analyzer - Auto-activating skill for Data Analytics. Triggers on: ab test analyzer, ab test analyzer Part of the Data Analytics skill category.

SamuelChien/mega-skills-collection

A B Test Config Creator - Auto-activating skill for ML Deployment. Triggers on: a b test config creator, a b test config creator Part of the ML Deployment skill category.

SamuelChien/mega-skills-collection

When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.

SamuelChien/mega-skills-collection

Acceptance Criteria Creator - Auto-activating skill for Enterprise Workflows. Triggers on: acceptance criteria creator, acceptance criteria creator Part of the Enterprise Workflows skill category.

SamuelChien/mega-skills-collection

Use when a coding task should be driven end-to-end from issue intake through implementation, review, deployment, and acceptance verification with minimal human re-intervention.

SamuelChien/mega-skills-collection

Accessibility Audit Runner - Auto-activating skill for Frontend Development. Triggers on: accessibility audit runner, accessibility audit runner Part of the Frontend Development skill category.

SamuelChien/mega-skills-collection

You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.

SamuelChien/mega-skills-collection

Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

SamuelChien/mega-skills-collection

Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.

SamuelChien/mega-skills-collection

Create unified specification packages across Business, Development, and Design teams. Staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria) to build shared understanding. Does not write code.

SamuelChien/mega-skills-collection

Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect enrichment tools or your CRM. Trigger with "research [company]", "look up [person]", "intel on [prospect]", "who is [name] at [company]", or "tell me about [company]".

SamuelChien/mega-skills-collection

Create forensically sound bit-for-bit disk images using dd and dcfldd while preserving evidence integrity through hash verification.

SamuelChien/mega-skills-collection

Validate messaging consistency across website, GitHub repos, and local documentation generating read-only discrepancy reports. Use when checking content alignment or finding mixed messaging. Trigger with phrases like "check consistency", "validate documentation", or "audit messaging".

相关技能