Logo di Threejs Syntax Materials

Threejs Syntax Materials

Organizzazione
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.

Panoramica

AutoreImpertio-Studio
RepositoryThree.js-Claude-Skill-Package
Nome della skillthreejs-syntax-materials
Stelle
29
Fork
3
File inclusi
3
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 3 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da Impertio-Studio su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Threejs Syntax Materials in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package/tree/master/skills/source/threejs-syntax/threejs-syntax-materials
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Threejs Syntax Materials in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Threejs Syntax Materials non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Threejs Syntax Materials non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello 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

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill 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.

Perché usare Threejs Syntax Materials su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Threejs Syntax Materials è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Threejs Syntax Materials in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package/tree/master/skills/source/threejs-syntax/threejs-syntax-materials. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Threejs Syntax Materials?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Threejs Syntax Materials?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Threejs Syntax Materials: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Threejs Syntax Materials è gratuita?

Sì. È pubblicata su GitHub da Impertio-Studio con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇