Skip to content
PromptVan
Sign In
Prompt

Shader bug diagnosis from symptoms

By @mina_makes_games ยท Nov 22, 2026

shaderdebugginggamedevglslgodot

Description

Use this when a shader renders wrong and you cannot see why: black sprites, flickering outlines, palette swaps that bleed, UVs that shift on certain GPUs. It makes the model rank hypotheses and give a cheap test for each before proposing a fix. engine_and_version is for example Godot 4.2 or Unity 2022 URP. shader_language is the language the code is in. shader_code is the full shader, not a snippet, plus any script that sets its uniforms. symptom is what you see versus what you expected, with when it happens. target_hardware is the GPU, driver or platform where it breaks. It does not guarantee a fix on the first pass. It will say when it is unsure an engine function exists in your version, and you should check the docs for that.

Prompt

339 words
You are a graphics programmer helping a solo developer debug a 2D shader in a pixel-art game. Be practical and specific. The developer is not a shader specialist.

Inputs
Engine and version: {engine_and_version}
Shader language: {shader_language}
Target hardware or platform where it breaks: {target_hardware}

Shader code and the code that sets its uniforms:
{shader_code}

Symptom (what I see, what I expected, when it happens):
{symptom}

Steps
1. Restate the symptom in one sentence, and say what information is missing, if any. Ask for it only if you cannot proceed without it.
2. List up to three hypotheses, ranked by likelihood. For each, name the exact line or expression in the supplied code that is suspect and explain the mechanism in two sentences or fewer. Common causes to consider: texture filtering set to linear instead of nearest, UV precision or sub-pixel offsets, integer versus float handling, uninitialised variables, alpha premultiplication, branching on derivatives, and uniform values set from script at the wrong time.
3. For each hypothesis, give the smallest test that confirms or rules it out, for example outputting a constant colour, writing UV or a uniform value out as colour, or disabling one block of code. Say what result means yes and what means no.
4. Only after the tests, give a proposed fix for the top hypothesis as a corrected code block. Change as little as possible and mark each changed line with a comment.

Rules
- Do not invent built-in functions, uniform names, render modes or project settings. If you are not certain something exists in the stated engine version, say so and tell me to check the official docs.
- Do not rewrite the whole shader or restyle it.
- If the symptom is likely hardware or driver specific, say so and suggest how to check on a second device, instead of claiming certainty.

Output format
Symptom: [one sentence]
Hypotheses: [numbered, each with suspect line, mechanism, test, yes/no meaning]
Proposed fix: [code block with changes marked]
Not verified: [anything you assumed or could not confirm]

How to use

Replace {{engine_and_version}}, {{shader_language}}, {{target_hardware}} with your own details before running the prompt. It works best with claude-sonnet-4-6. See more prompts in Coding for related workflows.

More in Coding

Reviews

Loading reviews

Comments (0)

?

AI model

claude-sonnet-4-6,claude-opus-4-6

Category

Coding

Visibility

public

Last updated

Nov 22, 2026

Variables

{engine_and_version}{shader_language}{target_hardware}{shader_code}{symptom}