Intermediate

Optimization

Case study

Tech-Art

I used texture units to speed up math on the GPU

5-10 min

When I first got into graphics, I liked to prototype effects using only shader code, without textures. It was a fun challenge during long train rides while I was studying. I had about three hours and no internet, so it was pushing my creativity.

Now that I have stronger GPU optimization skills, I went back to one of those old math-only shaders. I wanted to see if I could make it faster by shifting part of the work to the texturing units.

So, based on this experience:
💡 Compute and texturing run at the same time on the GPU. If texture fetches hit the cache often enough, they overlap with arithmetic and increase overall GPU throughput.

I tried this idea:
✔️ Start with a shader that does everything using math.
✔️ Move some of that math into texture lookups.
✔️ Balance the load between compute and texturing to find the best speed.
✔️ Ensure the shader logic stays mostly the same.

This is a case study I created in a form of slides, I hope it's good enough to read!



Related stuff

How do I profile GPUs - article about GPU profiling basics


___

This was originally a linkedin post

You can like and comment here: <note to myelf: remember to update the link>


Join the community

If you are interested in learning more,
join the community discussions on Saturday at 15:00 CET

We meet weekly, discussing the rendering and optimization problems.
Join our mastermind sessions, chill discussions and small online conference events.

Join the community

If you are interested in learning more,
join the community discussions on Saturday at 15:00 CET

We meet weekly, discussing the rendering and optimization problems.
Join our mastermind sessions, chill discussions and small online conference events.

I write expert content on optimizing Unity games, customizing rendering pipelines, and enhancing the Unity Editor.

Copyright © 2026 Jan Mróz | Procedural Pixels

I write expert content on optimizing Unity games, customizing rendering pipelines, and enhancing the Unity Editor.

Copyright © 2026 Jan Mróz | Procedural Pixels

I write expert content on optimizing Unity games, customizing rendering pipelines, and enhancing the Unity Editor.

Copyright © 2026 Jan Mróz | Procedural Pixels