← All resources

Per Texel Lighting

Auto-discovered

Blog Intermediate

Joshua Martinez

Visit resource ↗

Description

Per Texel Lighting is a February 2026 technical blog post by Joshua Martinez explaining a Unity project that lights and shadows objects per texture texel instead of per fragment.

Conceptually it maps texels from UV to world space with barycentric coordinates on mesh triangles, then lights by surface-to-light angle and shadows by ray-triangle tests, with optional distance-based soft shadows. The technical half walks C# setup and compute kernels for UV-to-world, dynamic lights, and combining baked with real-time lighting into a texture.

It is for intermediate Unity developers comfortable with compute shaders and mesh data who want a pixelated or retro lighting look.

The write-up is free HTML with diagrams, code excerpts, and a linked GitHub Unity project for the full C# side.

It is useful as a worked breakdown of texel-space lighting pipelines rather than a black-box effect demo.