Graphics Programming Plus AI
5 min read
Low Level
Low Level
AI can draft shaders and suggest optimizations. Performance and visual correctness are yours to verify.
Graphics Programming Plus AI
TL;DR
- AI can draft shaders, suggest rendering techniques, and help with optimization. It will also produce code that's slow, wrong, or platform-incompatible.
- Use AI for inspiration and first passes. You own performance, correctness, and cross-platform behavior.
- Graphics is highly platform-specific. AI doesn't know your GPU, your engine, or your constraints.
Graphics programming sits at the intersection of math, hardware, and art. AI has seen a lot of shader code and rendering docs. It can generate GLSL, HLSL, and explain techniques. It will also give you code that runs at 5 FPS or produces visual artifacts. Your job: use AI to explore, then lock down with your expertise.
What AI Can Help With
Shader drafting:
- "Implement a basic Phong shader" or "Add normal mapping." AI can scaffold. You tune for your pipeline.
- Good for learning and iteration. Always profile. Always check output.
Technique explanation:
- "How does PBR work?" "What's a shadow map?" AI can summarize papers and common implementations.
- Use as a starting point. Verify against authoritative sources.
Optimization ideas:
- "How can I make this faster?" AI might suggest LOD, batching, or different algorithms.
- Test. Graphics performance is counterintuitive. What works on one GPU can fail on another.
Porting and translation:
- GLSL to HLSL, or vice versa. AI can help. You verify semantics and extensions.
- Shader dialects differ. AI mixes them. Check.
What AI Gets Wrong
Platform specifics:
- Mobile vs. desktop. Vulkan vs. OpenGL vs. Metal. Driver quirks. AI doesn't know your target.
- You do. Validate on real hardware.
Performance:
- "This should be faster" — maybe. Branching, texture fetches, register pressure. AI doesn't profile your scene.
- Benchmark. Always. On your target hardware.
Visual correctness:
- Gamma, color space, precision. AI can produce code that "looks" right in a screenshot and breaks in edge cases.
- You have the eye. You know the spec.
Math and physics:
- AI can implement formulas. It can also get them wrong. Especially in edge cases or when combining techniques.
- Verify the math. Compare to references.
The Workflow
- Generate — Use AI for a first pass. Shader, technique, or optimization idea.
- Profile — Does it run? At what cost? On what hardware?
- Correct — Fix platform issues, precision, artifacts. Your standards.
- Integrate — Into your engine, your pipeline. AI doesn't know your stack. You do.
Your Moat
- Performance intuition. You know when a technique will work and when it won't. You've been burned. AI hasn't.
- Cross-platform mastery. You know the differences. You know the workarounds. That's years of experience.
- Aesthetic judgment. "Looks good" vs. "looks right" — you have the eye. AI has averages.
Manual process. Repetitive tasks. Limited scale.
Click "With AI" to see the difference →
Quick Check
What remains human when AI automates more of this role?
Do This Next
- Generate one shader with AI — A simple effect. Profile it. List what you had to fix. That's your QA process.
- Document your target constraints — Hardware, engine, budget. When you use AI, include these in your prompt. Better context = better output.
- Build a reference bench — A scene or test that represents your typical load. Use it to validate every optimization. AI or not.