Logotipo de Threejs Syntax Materials

Threejs Syntax Materials

Organización
Impertio-Studio
threejs-syntax-materials

Use when choosing or configuring materials, loading textures, or setting up PBR workflows in Three.js. Prevents the common mistake of wrong color space on textures, forgetting material.dispose(), or not calling material.needsUpdate after changes. Covers all 15+ material types, PBR metalness/roughness, MeshPhysicalMaterial, texture maps, color space. Keywords: MeshStandardMaterial, MeshPhysicalMaterial, material, texture, PBR, metalness, roughness, normalMap, color space, SRGBColorSpace, blurry texture, pixelated, texture quality, filtering.

Descripción general

EditorImpertio-Studio
RepositorioThree.js-Claude-Skill-Package
Nombre de la habilidadthreejs-syntax-materials
Estrellas
29
Forks
3
Archivos incluidos
3
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando una petición es realmente relevante.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • 3 archivos incluidos

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por Impertio-Studio en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Threejs Syntax Materials en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package/tree/master/skills/source/threejs-syntax/threejs-syntax-materials
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → Desde URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package.git /tmp/Three.js-Claude-Skill-Package
mkdir -p .claude/skills
cp -r /tmp/Three.js-Claude-Skill-Package/skills/source/threejs-syntax/threejs-syntax-materials .claude/skills/threejs-syntax-materials
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Threejs Syntax Materials en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición es relevante, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Threejs Syntax Materials automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Threejs Syntax Materials no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición relevante, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

threejs-syntax-materials

Quick Reference

Material Type Decision Tree

Use CaseMaterialWhy
UI elements, unlit scenesMeshBasicMaterialCheapest, no light computation
Matte diffuse (low-end devices)MeshLambertMaterialFast diffuse, no specular
Legacy specular highlightsMeshPhongMaterialBlinn-Phong model, not physically correct
General-purpose 3D (recommended)MeshStandardMaterialPBR metalness/roughness, industry standard
Glass, car paint, fabric, soap bubblesMeshPhysicalMaterialAdvanced PBR (clearcoat, transmission, sheen, iridescence)
Cartoon/anime styleMeshToonMaterialDiscrete cel-shading steps
Sculpting previews, no lightsMeshMatcapMaterialMatcap texture, zero light setup
Debug normalsMeshNormalMaterialRGB = surface normal direction
Invisible shadow receiverShadowMaterialTransparent shadow catcher
Solid linesLineBasicMaterialSimple colored lines
Dashed linesLineDashedMaterialRequires line.computeLineDistances()
ParticlesPointsMaterialPoint cloud rendering
BillboardsSpriteMaterialAlways-facing-camera quads

Base Material Properties (All Materials)

PropertyTypeDefaultDescription
sidenumberFrontSideFrontSide, BackSide, or DoubleSide
transparentbooleanfalseEnable alpha blending
opacitynumber1Requires transparent: true to take effect below 1
depthWritebooleantrueWrite to depth buffer
depthTestbooleantrueTest against depth buffer
blendingnumberNormalBlendingNoBlending, AdditiveBlending, SubtractiveBlending, MultiplyBlending, CustomBlending
alphaTestnumber0Discard fragments with alpha below this value
visiblebooleantrueWhether to render this material
wireframebooleanfalseWireframe rendering mode
fogbooleantrueAffected by scene fog
clippingPlanesPlane[]nullArray of clipping planes
clipIntersectionbooleanfalseClip where ALL planes intersect (vs union)
needsUpdatebooleanfalseSet true to trigger shader recompilation
toneMappedbooleantrueApply renderer tone mapping

Base Material Methods

MethodSignatureDescription
clone(): MaterialClone the material
copy(source: Material): MaterialCopy properties from source
dispose(): voidFree GPU resources -- ALWAYS call when removing
onBeforeCompile(shader, renderer): voidHook to modify shader before compilation
setValues(values: Object): voidSet multiple properties at once

Critical Warnings

NEVER set opacity < 1 without transparent: true -- the opacity value is silently ignored. ALWAYS pair them together.

NEVER use MeshPhysicalMaterial when MeshStandardMaterial suffices -- Physical compiles a significantly larger shader. ONLY use it when you need clearcoat, transmission, sheen, iridescence, or anisotropy.

NEVER set SRGBColorSpace on normal maps, roughness maps, metalness maps, or any data texture -- this corrupts the data and causes incorrect lighting. ONLY set SRGBColorSpace on diffuse/color/emissive textures.

NEVER forget to call material.dispose() and texture.dispose() when removing objects -- GPU memory leaks accumulate and crash the application.

NEVER set linewidth > 1 on LineBasicMaterial -- it is silently ignored on most platforms due to WebGL limitations. ALWAYS use Line2 + LineMaterial from three/addons/lines/ for thick lines.

ALWAYS set material.needsUpdate = true after changing properties that affect shader compilation (e.g., toggling flatShading, changing side, adding/removing texture maps at runtime).

ALWAYS set wrapS and wrapT to RepeatWrapping when using texture.repeat values other than (1, 1) -- the default ClampToEdgeWrapping does NOT tile textures.


MeshStandardMaterial (PBR)

The recommended material for most 3D scenes. Uses physically-based metalness/roughness workflow.

javascript
import { MeshStandardMaterial, TextureLoader, SRGBColorSpace, RepeatWrapping } from 'three';

const loader = new TextureLoader();
const material = new MeshStandardMaterial({
  color: 0xffffff,
  roughness: 0.7,           // 0 = mirror, 1 = fully rough
  metalness: 0.0,           // 0 = dielectric, 1 = metal
  map: null,                // Diffuse/albedo texture
  roughnessMap: null,       // Per-pixel roughness
  metalnessMap: null,       // Per-pixel metalness
  normalMap: null,          // Surface normal perturbation
  normalScale: new Vector2(1, 1),
  aoMap: null,              // Ambient occlusion (requires uv2)
  aoMapIntensity: 1.0,
  emissive: 0x000000,       // Emissive color
  emissiveMap: null,        // Emissive texture
  emissiveIntensity: 1.0,
  envMap: null,             // Environment reflection map
  envMapIntensity: 1.0,
  bumpMap: null,            // Grayscale height map
  bumpScale: 1.0,
  displacementMap: null,    // Vertex displacement map
  displacementScale: 1.0,
  displacementBias: 0.0,
  alphaMap: null,           // Per-pixel transparency
  lightMap: null,           // Baked lighting (requires uv2)
  lightMapIntensity: 1.0,
  flatShading: false,
  wireframe: false,
  fog: true
});

MeshPhysicalMaterial (Advanced PBR)

Extends MeshStandardMaterial with ALL its properties, plus:

PropertyTypeDefaultDescription
clearcoatfloat0.0Clear coat layer intensity (0-1)
clearcoatRoughnessfloat0.0Clear coat roughness
clearcoatMapTexturenullClear coat intensity map
clearcoatNormalMapTexturenullClear coat normal map
transmissionfloat0.0Physically-based transparency (0-1)
transmissionMapTexturenullTransmission map
thicknessfloat0.0Volume thickness for transmission
thicknessMapTexturenullThickness map
iorfloat1.5Index of refraction (1.0-2.333)
attenuationDistancefloatInfinityLight attenuation distance in volume
attenuationColorColorwhiteLight attenuation tint
sheenfloat0.0Sheen layer intensity (fabric-like)
sheenColorColor0x000000Sheen tint color
sheenRoughnessfloat1.0Sheen roughness
iridescencefloat0.0Thin-film interference (0-1)
iridescenceIORfloat1.3Iridescence index of refraction
iridescenceThicknessRange[float, float][100, 400]Thin-film thickness range (nm)
anisotropyfloat0.0Anisotropic reflection strength
anisotropyRotationfloat0.0Anisotropy rotation (radians)
specularIntensityfloat1.0Specular layer intensity
specularColorColorwhiteSpecular tint color
dispersionfloat0.0Chromatic dispersion (rainbow effect)
reflectivityfloat0.5Reflectivity at normal incidence

Texture System

Color Space Rules (Critical)

Map TypeColor SpaceChannels Used
map (diffuse/albedo)SRGBColorSpaceRGB(A)
emissiveMapSRGBColorSpaceRGB
lightMapSRGBColorSpaceRGB
envMapSRGBColorSpaceRGB
sheenColorMapSRGBColorSpaceRGB
specularColorMapSRGBColorSpaceRGB
normalMapNoColorSpaceRGB
roughnessMapNoColorSpaceG channel
metalnessMapNoColorSpaceB channel
aoMapNoColorSpaceR channel
bumpMapNoColorSpaceR channel
displacementMapNoColorSpaceR channel
alphaMapNoColorSpaceR channel
clearcoatMapNoColorSpaceR channel
clearcoatRoughnessMapNoColorSpaceR channel
clearcoatNormalMapNoColorSpaceRGB
transmissionMapNoColorSpaceR channel
thicknessMapNoColorSpaceR channel
iridescenceMapNoColorSpaceR channel
iridescenceThicknessMapNoColorSpaceR channel
sheenRoughnessMapNoColorSpaceR channel
anisotropyMapNoColorSpaceRG channels
specularIntensityMapNoColorSpaceA channel

Rule: Diffuse/emissive/color textures = SRGBColorSpace. ALL data textures = NoColorSpace. Getting this wrong causes washed-out or over-saturated rendering.

Texture Loaders

LoaderFormatImport
TextureLoaderPNG, JPG, WebPthree core
CubeTextureLoader6x PNG/JPG cube mapsthree core
RGBELoader.hdr (Radiance HDR)three/addons/loaders/RGBELoader.js
EXRLoader.exr (OpenEXR HDR)three/addons/loaders/EXRLoader.js
KTX2Loader.ktx2 (GPU compressed)three/addons/loaders/KTX2Loader.js

Wrapping Modes

ConstantDescription
ClampToEdgeWrappingEdge texels stretched (default)
RepeatWrappingTexture tiles/repeats
MirroredRepeatWrappingTiles with alternating mirror

Filter Modes

ConstantTypeDescription
NearestFilterMag/MinPixelated, crisp (retro, toon gradients)
LinearFilterMag/MinSmooth interpolation
LinearMipmapLinearFilterMinTrilinear filtering (default, best quality)

Texture Properties

PropertyTypeDefaultDescription
wrapS / wrapTnumberClampToEdgeWrappingWrapping mode
magFilternumberLinearFilterMagnification filter
minFilternumberLinearMipmapLinearFilterMinification filter
anisotropynumber1Anisotropic filtering (max = renderer.capabilities.getMaxAnisotropy())
repeatVector2(1, 1)UV repeat count
offsetVector2(0, 0)UV offset
rotationnumber0UV rotation in radians
centerVector2(0, 0)Center of rotation
flipYbooleantrueFlip vertically on upload
colorSpacestringNoColorSpaceColor space interpretation
generateMipmapsbooleantrueAuto-generate mipmaps
needsUpdatebooleanfalseTrigger GPU re-upload

flipY Rules

  • flipY = true (default): Correct for loaded image textures (PNG, JPG)
  • flipY = false: ALWAYS use for WebGLRenderTarget textures, DataTexture, and framebuffer textures

Material Disposal

javascript
// ALWAYS dispose materials and textures when removing objects
function disposeMesh(mesh) {
  if (mesh.material) {
    // Dispose all texture maps
    for (const key of Object.keys(mesh.material)) {
      const value = mesh.material[key];
      if (value && value.isTexture) {
        value.dispose();
      }
    }
    mesh.material.dispose();
  }
  if (mesh.geometry) {
    mesh.geometry.dispose();
  }
}

needsUpdate Flag

ALWAYS set material.needsUpdate = true after changing these at runtime:

  • Toggling flatShading
  • Changing side (FrontSide/BackSide/DoubleSide)
  • Adding or removing a texture map (e.g., setting map from null to a texture)
  • Changing transparent or alphaTest
  • Toggling wireframe
  • Any property that changes the compiled shader variant

NEVER set needsUpdate = true every frame -- it forces expensive shader recompilation. ONLY set it once after the property change.

For textures: set texture.needsUpdate = true after modifying texture.image data to trigger GPU re-upload.


Toon Material Special Rule

When using MeshToonMaterial, ALWAYS set gradientMap.minFilter = NearestFilter and gradientMap.magFilter = NearestFilter. Linear filtering blurs the discrete shading steps into smooth gradients, defeating the toon effect.


Reference Links

Official Sources

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Se ofrecen como archivos de lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Threejs Syntax Materials?

Use when choosing or configuring materials, loading textures, or setting up PBR workflows in Three.js. Prevents the common mistake of wrong color space on textures, forgetting material.dispose(), or not calling material.needsUpdate after changes. Covers all 15+ material types, PBR metalness/roughness, MeshPhysicalMaterial, texture maps, color space. Keywords: MeshStandardMaterial, MeshPhysicalMaterial, material, texture, PBR, metalness, roughness, normalMap, color space, SRGBColorSpace, blurry texture, pixelated, texture quality, filtering.

¿Por qué usar Threejs Syntax Materials en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Threejs Syntax Materials está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Threejs Syntax Materials en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package/tree/master/skills/source/threejs-syntax/threejs-syntax-materials. TypingMind lee su archivo SKILL.md, empaqueta sus archivos y la instala como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Threejs Syntax Materials?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Threejs Syntax Materials?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Threejs Syntax Materials con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Threejs Syntax Materials?

Sí. Impertio-Studio la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇