Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
GlossaryNovember 22, 20263 min read

What is a shader?

Water ripples, glowing outlines, a damage flash: shaders paint them on the graphics chip. Here is what a shader is, the two main kinds, and when they slow a game down.

Startbase Team
Editorial ink illustration of a stained-glass lantern lighting a plain clay figurine, the central glass pane in ember orange

Key takeaways

  • A shader is a tiny program that runs on the GPU, once per vertex or once per pixel, in parallel.
  • Vertex shaders move points of a shape; fragment (pixel) shaders decide each pixel's color.
  • Full-screen shader effects on high-resolution phones are the usual cost: test them on a mid-range device.

Running on the graphics chip (GPU), a shader is a short program that decides where each point of a shape goes or what color each pixel on screen should be, executed for thousands of points or millions of pixels at the same time.

Think of a stage lighting crew. The props (models and sprites) stay the same, but colored gels, spotlights and a fog machine completely change how the scene looks. Shaders are that crew, working on every pixel at once.

The two kinds you will hear about

  • Vertex shaders run once per corner (vertex) of a shape. They position it on screen and can move it: grass that sways, a flag that waves, water whose surface bobs.
  • Fragment shaders, also called pixel shaders, run once per pixel the shape covers. They pick the color: lighting, textures, a white flash when an enemy is hit, a dissolve effect, outlines, a retro CRT filter.

On the web, shaders are written in GLSL for WebGL (newer WebGPU uses a language called WGSL). Three.js builds standard ones for you; a material like "metal with this roughness" is a shader under the hood. PixiJS uses shaders for its filters, such as blur and color tweaks.

What shaders are good for in small games

You do not need custom shaders to make a good game, but a few cheap ones add a lot of polish:

  • Hit flash: tint a sprite pure white for 0.06 to 0.1 seconds on damage. Clearer than any particle effect.
  • Palette swap: reuse one enemy sprite in red, blue and gold variants by remapping colors.
  • Water and heat shimmer: distort what is behind a surface with a scrolling noise texture.
  • Outlines and silhouettes: show the player behind walls, or highlight what can be picked up.
  • Screen-wide mood: vignette, color grading for night, a gentle CRT curve for a retro look (weather effects often combine these).

What they cost on phones

A fragment shader runs for every pixel it covers, so cost scales with screen area. A modern phone screen can be around 3 million pixels; a full-screen effect with a heavy blur means millions of shader runs per frame, 60 times a second. That is how a pretty effect on a laptop becomes a stutter on a phone. Starting rules: keep full-screen effects to one or two cheap passes, render blur at half resolution, and turn off post-processing on low-end devices. See game performance on phones.

Shaders when building with Startbase

You never need to write GLSL. Describe the effect and when it appears, and say how it should look on a slow phone. For 3D games, materials and lighting are shader choices too, which is worth knowing when a low-poly scene looks flat (low-poly 3D art guide).

Add three shader effects: a 0.08 second white flash on any enemy that takes damage, a slow water ripple on the lake tiles, and a soft vignette at night. Render the vignette and any blur at half resolution, and disable the ripple on devices that drop below 50 fps.

Common confusions

  • Shader vs texture. A texture is an image; the shader is the program that decides how that image is drawn and lit.
  • Shader vs particle effect. Particles are many small sprites (particle systems); a shader changes how pixels look. Many effects combine both.
  • Shader compilation stutter. The first time a new shader is used it may compile, causing a one-off hitch. Warm effects up during loading.

Frequently asked questions

Do browser games use shaders?

Yes. Anything drawn with WebGL or WebGPU goes through shaders, including PixiJS and Three.js games. Libraries generate the standard ones; custom shaders add special effects.

Why does a shader effect lag on my phone but not my computer?

Fragment shaders run per pixel, and phone GPUs have less headroom for high-resolution full-screen passes. Lower the effect's resolution or simplify it on mobile.

On this page

  • The two kinds you will hear about
  • What shaders are good for in small games
  • What they cost on phones
  • Shaders when building with Startbase
  • Common confusions

Keep reading

More in Glossary
Editorial ink illustration of a hand-cranked music box drum plucking a metal comb, the crank handle in ember orange
GlossaryNovember 22, 2026

What is a game loop?

Every real-time game runs one repeating cycle: read input, update the world, draw it. Here is what that cycle looks like and why it decides how your game feels.

3 min read
Editorial ink illustration of a brass stopwatch beside a small wind-up toy car, the second hand in ember orange
GlossaryNovember 22, 2026

What is delta time?

Delta time is the number that keeps your game the same speed on every screen. Here is how to use it, where it breaks, and how to spot a game that forgot it.

3 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.