Repository inventory

cloudai-x/threejs-skills

Skills indexed from this repository, with install-style signals scoped to the repo.
10 skills9.6K GitHub stars0 weekly installsGitHubOwner profile

Overview

This skill documents Three.js materials and practical usage for styling meshes, textures, shaders, and optimizing material performance. It covers built-in material types (PBR, basic, phong, toon, depth, normal), shader materials, common properties, environment maps, and performance guidance. Use it to pick the right material and configure material properties for real-time rendering.

How this skill works

The skill explains what each material type does and which lighting model it uses (unlit, Lambert, Phong, PBR). It shows common properties and texture slots, how to set up environment maps and HDRI, and how to create custom shaders with ShaderMaterial and RawShaderMaterial. Performance tips and best practices explain when to reuse, dispose, or simplify materials for efficient draw calls.

When to use it

  • Styling static or animated meshes with the appropriate lighting model
  • Applying textures: albedo, normal, roughness, metalness, ao, displacement
  • Building realistic surfaces using MeshStandardMaterial or MeshPhysicalMaterial
  • Creating stylized looks with MeshToonMaterial or debugging with MeshNormalMaterial
  • Implementing custom vertex/fragment effects using ShaderMaterial or RawShaderMaterial
  • Optimizing scenes by reducing material complexity and reusing material instances

Best practices

  • Prefer MeshStandardMaterial for realistic PBR results; use MeshPhysicalMaterial only when advanced features (clearcoat, transmission) are required
  • Reuse materials to enable GPU batching and reduce draw calls; use a material cache or pooling
  • Avoid unnecessary transparency; prefer alphaTest for masked transparency to skip expensive sorting
  • Limit the number of dynamic lights and texture lookups in shaders to reduce fragment cost
  • Call material.dispose() and texture.dispose() when geometry or materials are removed to free GPU memory

Example use cases

  • Create a car shader with clearcoat, anisotropy and metallic flakes using MeshPhysicalMaterial
  • Make a glass object with transmission, thickness, and IOR for believable refraction
  • Use MeshToonMaterial with a custom gradientMap for cel-shaded characters
  • Debug normal or topology issues with MeshNormalMaterial and visualize depth with MeshDepthMaterial
  • Author a procedural water or ripple effect using ShaderMaterial uniforms and time-based animation

FAQ

Use MeshStandardMaterial (PBR) for realistic materials and consistent lighting under environment maps. Use MeshPhong for simpler shiny surfaces where full PBR features aren’t needed and slightly cheaper shading is acceptable.

Do I always need to set material.needsUpdate = true?

No. needsUpdate is required after structural changes like swapping shaders, changing flatShading, toggling transparency, or replacing textures. Simple color or uniform updates typically do not require it.

10 skills

threejs-shaders
Code Review

This skill helps you create and customize visual effects in Three.js using ShaderMaterial and GLSL shaders for dynamic graphics.

DebuggingFrontendPerformanceScripting
threejs-materials
Debugging

This skill helps you select, configure, and optimize Three.js materials for realistic, stylized, and performant 3D scenes.

FrontendPerformance
threejs-interaction
Ai

This skill helps you implement robust Three.js interaction with raycasting, camera controls, and input handling for interactive 3D experiences.

DebuggingFrontendPerformanceTesting
threejs-lighting
Debugging

This skill helps you implement and optimize Three.js lighting, shadows, and environment lighting to improve realism and performance.

DocsFrontendPerformanceScripting
threejs-geometry
Debugging

This skill helps you create and customize 3D shapes in Three.js with built-in geometries, custom buffers, and efficient instancing for scalable scenes.

FrontendGitObservabilityPerformance+1
threejs-fundamentals
Debugging

This skill helps you set up and optimize Three.js scenes, cameras, renderers, and object hierarchies for accurate 3D transforms.

DocsFrontendPerformanceScripting
threejs-postprocessing
Debugging

This skill enables you to implement Three.js post-processing with EffectComposer, bloom, DOF, color grading, and screen-space shaders for enhanced visuals.

DocsFrontendPerformanceScripting
threejs-animation
Frontend

This skill helps you implement and optimize Three.js animations, including keyframes, skeletons, morph targets, and blending for responsive 3D motion.

PerformanceScripting
threejs-loaders
Debugging

This skill helps you manage three.js asset loading with loaders, progress tracking, and best practices for textures, models, and HDR environments.

FrontendPerformance
threejs-textures
Debugging

This skill helps you manage Three.js textures end-to-end, from loading and config to UV mapping and environment maps, boosting visual fidelity.

DocsPerformanceScripting
More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational