Can AI fix a ChatGPT-made Godot shader? We tested Ziva on a real forum shader
This post is one section of our full guide, Godot Shaders in 2026: A Practical Guide to GDShader.
Tested: an AI fixing a ChatGPT-made shader in the editor
A chat assistant can write GDShader, but it cannot compile what it writes. You paste the code into Godot, copy the error back, and repeat. An agent inside the editor can compile each change and look at the running scene. We tested that loop with Ziva on a real broken shader.
The shader comes from a Godot forum post from December 2025 (Godot 4.5). Its author "made the individual parts with the help of ChatGPT" and stitched them into one canvas_item shader: background removal, blur, an overlay texture and color correction. With every module at its default, the sprite came out "much more contrasty" and lost "a lot of brightness".
Copied from the forum page, the shader does not even compile, because the forum's formatting dropped some * signs (6.0d instead of 6.0 * d). We put that exact text in a project, with the Godot icon twice: one plain sprite and one with the shader. Then we asked Ziva, paraphrasing the author's post, to fix it so the defaults leave the image alone and to show both sprites side by side.
Here is what it did:
- It listed the broken tokens (
6.0d,c.x6.0,2.0boand more) and sent eight edits at once, most fixing one token each. Every edit was rejected. Ziva compiles a shader after each edit and reverts the edit if Godot reports an error, and the other broken lines were still there. So it rewrote the whole file in one go. That revert is a Ziva bug, and we have filed it. - The rewrite loaded without errors in the editor but failed when the scene ran, because it had moved
TEXTUREandCOLORinto helper functions, wherecanvas_itemshaders cannot read them. Ziva read the error from the run and passed them in as parameters. - The next run reproduced the author's problem: the shaded sprite was darker and more contrasty. Ziva built small test scenes to isolate it. A one-line shader,
COLOR = texture(TEXTURE, UV);, matched the original; the matting-only and color-only versions were already dark. - It checked Godot's shading docs, which say that in
fragment()the inputCOLORis already multiplied by the texture. The stitched shader started withvec4 col = texture(TEXTURE, UV) * COLOR;, which applies the texture twice. That is the same line a forum member identified by hand. - Ziva rewrote that line, ran the scene, measured the two sprites with a throwaway pixel check, deleted its 10 debug files and showed the final screenshot. It took 12 minutes and 48 tool calls, and used $0.12 of Ziva usage on Ziva Smart, the default model.
Our own check, a separate script that rendered the fixed scene, found no pixel difference between the two sprites at the defaults. With contrast, hue, blur or background removal turned up, the shaded sprite changed as expected, so the four modules we tried still worked.
The fix for anyone with the same symptom is one line
In a canvas_item shader, start from COLOR, not texture(TEXTURE, UV) * COLOR:
vec4 col = COLOR; // already texture color * modulate
Ziva.sh makes Ziva and wrote this test. We ran it on 10 November 2026 with Godot 4.7.2 on Linux and a development build of Ziva. It is one shader and one run, so treat it as an example, not a benchmark.
Without that loop, you are pasting code into ChatGPT and copying error messages back. The forum author spent "quite a while" trying to make the stitched ChatGPT code run without errors before asking for help. For a broader survey of AI tools in the Godot pipeline, see Best AI Tools & Plugins for Godot Game Engine.
FAQ
Can AI write and fix Godot shaders?
It can write GDShader, but a chat assistant cannot compile what it writes, so you find the errors yourself. An agent inside the Godot editor can compile each change and look at the result. We tested Ziva on a shader from the Godot forum that its author had built with ChatGPT: it fixed the compile errors, found why the sprite came out darker, and showed both sprites side by side. Our own pixel check found them identical. It took 12 minutes and $0.12 of Ziva usage on the default model.
Why does my Godot canvas_item shader make the sprite darker?
A common cause is texture(TEXTURE, UV) * COLOR in fragment(). In a canvas_item shader, COLOR already holds the texture color multiplied by the vertex color, so multiplying by the texture again applies it twice. Use COLOR on its own, or texture(TEXTURE, UV) without the extra COLOR, unless you need the modulate color.
Comments
No comments yet. Start the discussion.