cesiumgs/cesiumjs-skills/cesiumjs-materials-shaders
Claude Code and agent skill by cesiumgs/cesiumjs-skills
- community
Checking that the SKILL.md file is still in the repository.
CesiumJS materials and post-processing — Material, Fabric JSON, MaterialAppearance, ImageBasedLighting, PostProcessStage, PostProcessStageLibrary, bloom, depth of field, ambient occlusion, FXAA, tonemapping, BlendingState. Use when defining Fabric materials for entities or primitives, configuring PBR image-based lighting, or adding screen-space post-processing effects.
Install
npx vskill@latest install cesiumgs/cesiumjs-skills/cesiumjs-materials-shadersSKILL.md
CesiumJS Materials, Shaders & Post-Processing
Version baseline: CesiumJS 1.144 (August 2026). All imports use ES module style.
Material System (Fabric JSON)
Material defines surface appearance for Primitives through a JSON schema called Fabric. Materials compile to GLSL and are consumed by MaterialAppearance or PolylineMaterialAppearance.
While a material's image loads, CesiumJS renders a placeholder texture that defaults to white. Since 1.144 the static Texture.defaultColor changes that placeholder color to avoid white flashes during material construction. Note that the Texture class is runtime-public but absent from the published TypeScript definitions, so TypeScript callers need a cast.
Built-in Material Types
Surface: Color (color), Image (image, repeat), DiffuseMap, AlphaMap, SpecularMap, EmissionMap (image, channel(s), repeat), BumpMap, NormalMap (image, channel(s), strength, repeat).
Patterns: Grid (color, cellAlpha, lineCount, lineThickness), Stripe (evenColor, oddColor, repeat), Checkerboard (lightColor, darkColor, repeat), Dot (lightColor, darkColor, repeat).
Effects: Water (baseWaterColor, blendColor, normalMap, frequency, animationSpeed, amplitude), RimLighting (color, rimColor, width), Fade (fadeInColor, fadeOutColor, maximumDistance).
Terrain: ElevationContour (color, spacing, width), ElevationRamp (image, minimumHeight, maximumHeight).
Polyline: PolylineArrow (color), PolylineDash (color, gapColor, dashLength, dashPattern), PolylineGlow (color, glowPower, taperPower), PolylineOutline (color, outlineColor, outlineWidth).
Creating Materials
Fabric materials are for primitive appearances. Do not use non-existent entity constructors such as WaterMaterialProperty; for the built-in water material, create Material.fromType("Water", ...) and apply it through MaterialAppearance on a Primitive.
Custom Fabric with GLSL Source
Use source for inline GLSL. Uniforms declared in uniforms are available by name in the shader.
Applying Materials to Primitives
Compositing Sub-Materials (Fabric materials + components)
CustomShader
CustomShader injects user GLSL into Model, Cesium3DTileset, and VoxelPrimitive rendering, with access to vertex attributes, feature IDs, and EXT_structural_metadata.
For shader authoring — struct reference, metadata access, feature IDs, voxel subset, 1.139 breaking changes, and seven worked examples — see the `cesiumjs-custom-shader` skill. This skill owns the CustomShader integration surface; the authoring depth lives there.
Minimal example:
ImageBasedLighting
Controls PBR image-based lighting for Model and Cesium3DTileset. imageBasedLightingFactor (Cartesian2) scales diffuse (x) and specular (y) from 0 to 1. Diffuse comes from sphericalHarmonicCoefficients (array of 9 Cartesian3, L0-L2). Specular comes from specularEnvironmentMaps (URL to KTX2 cube map).
Post-Processing
Screen-space pipeline via viewer.scene.postProcessStages (PostProcessStageCollection). Stages execute in order; each reads colorTexture and depthTexture.
Built-in Effects (PostProcessStageLibrary)
All factory functions return stage composites that must be added via viewer.scene.postProcessStages.add().
createBloomStage() (contrast, brightness, glowOnly, delta, sigma, stepSize), createBlurStage() (delta, sigma, stepSize), createDepthOfFieldStage() (focalDistance, delta, sigma, stepSize), createEdgeDetectionStage() (color, length), createSilhouetteStage([edgeStage]) (wraps an edge detection stage into a silhouette composite), createBlackAndWhiteStage() (gradations), createBrightnessStage() (brightness), createNightVisionStage(), createLensFlareStage() (intensity, distortion, ghostDispersal, haloWidth).
Bloom via factory (use this to add a distinct bloom instance via postProcessStages.add):
Silhouette via factory (pass an edge detection stage into the silhouette composite):
Collection Stages (Bloom, AO, FXAA, Tonemapping)
The collection exposes always-present built-in composites for bloom, ambient occlusion, and FXAA — these do not require add(). Tonemapping defaults to PBR_NEUTRAL.
Night/bloom visual evals: bloom should make bright city lights glow whilepreserving dark surrounding areas. If an OSM base layer is present beneathnight imagery, reduce the base layer'salpha/brightnessand use restrainedbloom (brightnessmore negative, lower exposure) so labels and land do notwash out to white. A pale daylight map with yellow haze is not a successfulnight-lights render.
Custom PostProcessStage
Custom stages receive colorTexture, depthTexture (sampler2D) and v_textureCoordinates (vec2). Output via out_FragColor. Uniforms can be constants or functions (re-evaluated each frame).
Selected Feature Highlighting
Use czm_selected() in the fragment shader and assign features to stage.selected.
PostProcessStageComposite
Managing Stages
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cesiumjs-materials-shaders/SKILL.md
Popularity
- Repository stars
- 77
- Repository forks
- 12
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 7 Jun 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cesiumgs/cesiumjs-skills/cesiumjs-materials-shaders)