跳到正文
Skillpedia
界面(UI/UX)48k · #5490

premium-3d-website

它能做什么

这份指南介绍如何打造精美、高质量的 3D 网站。它重点讲解高级视觉效果、逼真的交互体验,以及性能优化,确保网站在各种设备上都能流畅运行。

适用场景

  • ✓制作带有 3D 元素的创意网站时。
  • ✓添加发光、模糊等特殊视觉效果时。
  • ✓让 3D 物体对鼠标点击或悬停做出反应时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/premium-3d-website/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/premium-3d-website/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“怎样才能让鼠标悬停在 3D 立方体上时,它会发光?”

每周 5 个新技能,1 分钟读完。

工作原理

它的做法包括:在浏览器中搭建 3D 图形的基础框架,添加发光和模糊等视觉效果,并集成物理引擎,让物体对用户的操作做出反应。此外,还包含让页面快速加载和适配手机的技巧。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Premium 3D Website

Overview

This skill provides architectural guidelines and code patterns for developing premium, high-end 3D websites. It targets developers looking to implement advanced WebGL visual effects, custom shader pipelines, interactive physics elements, and immersive page transitions while maintaining high performance.

When to Use This Skill

  • Use when designing premium or award-winning creative websites with 3D elements.
  • Use when integrating Three.js, React Three Fiber (R3F), or Spline with custom shaders (GLSL).
  • Use when implementing post-processing effects like bloom, depth-of-field, or custom film grain.
  • Use when designing interactive preloaders and high-performance asset loading strategies.
  • Use when optimizing complex 3D scenes for mobile responsiveness and performance.

How It Works

Step 1: Establish the Render Loop and Scene Architecture

Setting up a robust WebGL context with proper resize handling and performance-friendly pixel ratios is crucial. Keep pixel ratios capped at a maximum of 2 to avoid rendering too many pixels on high-DPI screens.

Step 2: Implement Shader Effects and Post-Processing

Incorporate post-processing pipelines (using EffectComposer or @react-three/postprocessing) to add bloom, chromatic aberration, depth of field, or film grain. Keep pass counts low and combine custom fragment shaders to minimize draw calls.

Step 3: Integrate Interactive Physics and Motion

Utilize physics frameworks (such as Cannon.js or Rapier) or procedural spring animations to make 3D objects react to mouse hover, drag, and click inputs with organic feedback.

Step 4: Asset Pipeline and Preloader

Optimize 3D models (using Draco compression) and load them using custom loading managers. Render interactive preloaders to entertain users while heavy assets are fetched in the background.

Examples

Example 1: Custom Post-processing in React Three Fiber (R3F)

import { Canvas } from '@react-three/fiber';
import { EffectComposer, Bloom, DepthOfField, Vignette } from '@react-three/postprocessing';

export default function PremiumComposer() {
  return (
    <Canvas dpr={[1, 2]} gl={{ powerPreference: "high-performance", antialias: false }}>
      <ambientLight intensity={0.5} />
      <mesh>
        <boxGeometry />
        <meshStandardMaterial emissive="orange" emissiveIntensity={2.0} />
      </mesh>
      
      <EffectComposer disableNormalPass>
        <DepthOfField focusDistance={0} focalLength={0.02} bokehScale={2} height={480} />
        <Bloom luminanceThreshold={0.3} luminanceSmoothing={0.9} height={300} />
        <Vignette eskil={false} offset={0.1} darkness={1.1} />
      </EffectComposer>
    </Canvas>
  );
}

Example 2: Custom GLSL Shader Material for Liquid/Wavy Effects

import * as THREE from 'three';

const CustomWavyMaterial = new THREE.ShaderMaterial({
  vertexShader: `
    varying vec2 vUv;
    uniform float uTime;
    void main() {
      vUv = uv;
      vec3 pos = position;
      pos.z += sin(pos.x * 5.0 + uTime) * 0.1;
      pos.z += cos(pos.y * 5.0 + uTime) * 0.1;
      gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
    }
  `,
  fragmentShader: `
    varying vec2 vUv;
    uniform float uTime;
    uniform vec3 uColor;
    void main() {
      float pulse = 0.5 + 0.5 * sin(uTime + vUv.x * 10.0);
      gl_FragColor = vec4(uColor * pulse, 1.0);
    }
  `,
  uniforms: {
    uTime: { value: 0.0 },
    uColor: { value: new THREE.Color('#3b82f6') }
  }
});

Best Practices

  • ✅ Set dpr={[1, 2]} to restrict the device pixel ratio to a maximum of 2.
  • ✅ Disable antialiasing on the WebGLRenderer when post-processing is active to prevent double-aliasing performance penalties.
  • ✅ Bake ambient occlusion, lighting, and shadows into textures using Blender or other 3D software instead of using dynamic lights and real-time shadows.
  • ✅ Use instance rendering (THREE.InstancedMesh or R3F <Instances>) for scenes containing multiple identical meshes.
  • ❌ Avoid using uncompressed GLTF/OBJ models. Always compress models using Draco or Meshopt.
  • ❌ Avoid real-time shadow maps (such as THREE.DirectionalLightShadow) on mobile or low-end devices due to the heavy performance overhead.

Limitations

  • This skill does not replace environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, or safety boundaries are missing.

…

常见问题

为什么我的 3D 网站在手机上很卡?

如果网站尝试渲染过多细节,就可能出现这种情况。应该为手机设备限制图像质量,并关闭不必要的特效。

怎样让网站加载得更快?

可以使用“预加载器”(preloader),在较大的 3D 文件下载期间显示一些有吸引力的内容。另外,也可以优化 3D 模型,让它们的文件体积更小。

什么是“着色器”(shader)?

它就像一组小指令,告诉电脑如何在 3D 表面上绘制颜色和效果,从而实现独特的自定义视觉效果。

详情

作者的原始描述

Guidelines for building premium 3D websites, focusing on custom WebGL shaders, post-processing, physics-based interactions, smooth animations, preloaders, and device optimization.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5490
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能