finds.dev← search

// the find

keijiro/AIShader

★ 2,385 · C# · updated Dec 2023

ChatGPT-powered shader generator for Unity

A proof-of-concept Unity Editor extension that lets you describe a shader in plain English and get ChatGPT to generate the HLSL/ShaderLab code, wired in as a custom AssetImporter so '.aishader' files behave like any other importable asset. Aimed at Unity devs experimenting with LLM-assisted shader authoring, not at anyone wanting a finished tool.

Using AssetImporter to make prompts a first-class asset type (right-click, reimport, inspector settings) is a genuinely clever integration point rather than a bolted-on menu item. The codebase is tiny (four scripts: importer, importer editor, settings, and a thin OpenAI wrapper), so it's readable in ten minutes and easy to fork or gut for your own prompt logic. Coming from keijiro, the code quality per line is higher than the average weekend hack, even though the project itself is explicitly scoped as a demo.

The README itself calls this a proof-of-concept, and the repo backs that up: no tests, no examples beyond one GIF, and no discussion of how well the generated shaders actually compile or perform. It stores the OpenAI API key in a plaintext UserSettings asset and just tells you to remember to gitignore it — a classic way to leak a key the first time someone forgets. Last commit is from December 2023, so it predates every OpenAI model since GPT-4-era and has had no maintenance for API changes, deprecations, or newer models with better code generation. There's no handling shown for the generated shader failing to compile, which is the common case when an LLM writes ShaderLab without seeing your project's includes or Unity version.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →