<!--
{
  "documentType" : "article",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/getting-started-with-particle-shaders",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Getting Started with Particle Shaders"
}
-->

# Getting Started with Particle Shaders

Provide custom shader code to alter a particle’s look.

## Discussion

Use the shader property of an emitter node to change the appearance of a texture with a custom OpenGL ES fragment shader embedded within an [`SKShader`](/documentation/SpriteKit/SKShader). Custom shaders offer almost limitless possibilities, from adding blurs and color treatments to textures, to generating imagery such as random noise.

The following code shows a custom shader that renders particles with a radial gradient. The center of each particle is opaque white and the edges are transparent black.

```swift
let emitter = SKEmitterNode()
    
let radialGradientShader = SKShader(source: "void main() {" +
    "    vec2 coord = (v_tex_coord - 0.5) * 2.0;" +
    "    gl_FragColor = vec4(1.0 - length(coord));" +
    "}")  
      
emitter.shader = radialGradientShader
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)