r/GraphicsProgramming • u/gibson274 • Jun 04 '26
LLM’s can’t do graphics programming
I have generally been tracking LLM progress and attempting to integrate LLM’s into my workflow. My two cents: LLM’s are not currently capable of high-level autonomous graphics programming.
Here are some anecdotes I’ve collected over a series of experiments and production tests that I hope will add some color to the current discussion being had in posts on this sub/elsewhere.
Shader Obfuscator
2 months ago, I tested Claude code (using Opus 4.6) on some tasks for a custom HLSL obfuscation pipeline I built in rust. It parses a simple AST from HLSL and then runs various AST transforms on it to make it unreadable to the average programmer.
Claude was able to successfully implement very simple features and refactors. It was also able to quickly stamp out plausible boilerplate given high level descriptions. This was awesome because there’s a lot of these sorts of tasks involved in writing a compiler front end, and using an LLM made the process more enjoyable.
That said, it was not able to handle anything of intermediate complexity, even with a pretty good description of exactly what should be done and a lot of hand-holding. It would often make subtle mistakes that I would catch in tedious fine-grained reviews.
Contrary to what others have said: it could not produce meaningful unit tests on its own. The tests it wrote looked extensive at first glance, but they were just verbose and repetitive. They typically missed critical edge cases present in real shader files.
I think this is an interesting case because this project was favorable to the LLM (heavily unit-tested, CLI interface, small number of lines of code, few external dependencies), but also algorithmically complex enough to evaluate its problem solving skills. On the latter, it performed worse than I expected.
Volume Renderer
~1 month ago, I used Claude Opus 4.7 to vibe code a real-time volume renderer from scratch with Web GPU and Rust.
My goal with this experiment was to evaluate both the degree to which a non-expert could have success in this matter, and failing that, the effectiveness of LLM’s at translating a very high level implementation request from an expert into a working solution.
I understand that this is not the most effective way to use an LLM; a tight spec where you describe exactly what you want in detail is best. But, the capability to do this kind of hands-off work is what is being advertised and hyped, so I think it’s important to circumscribe the boundaries of what is possible.
I was actually stunned when after ~10 mins of churning, it produced a working prototype that imported an open VDB file to a 3D texture, set up a simple camera + viewport, and successfully ray marched the volume.
That is more or less where the successes ended though.
I tried to get it to optimize the ray-marching loop—starting with deliberately vague non-expert requests to just “make it faster” and then progressing to targeted algorithmic suggestions. It had quite a hard time with the open-ended nature of these requests; often it would undo work it had previously done when I provided new suggestions, and ultimately it failed to implement anything meaningful.
I also attempted to get it to iterate on the lighting techniques by providing screenshots. No luck here: it could not translate visual critiques to solutions, even with progressively specific algorithmic guidance.
Finally, I asked for a trivial adjustment to the camera controller to make it more intuitive to fly around. I expected it to be able to do this, but it failed.
When I read the code, it was a bizarre combination of clean and messy; highly documented but overly verbose, with tons of unused functions. It only got messier as I asked for more modifications.
Final thoughts on this one: someone without experience would likely not push past the initial result to discover that LLM’s can’t currently vibe out unique graphics functionality. This may explain some of the conflict in discourse on the topic.
The structure of the successes/failures makes me slightly more confident that as of 2026 LLM’s continue to associatively interpolate the latent space of all code they’ve been trained on (including hand-tuned “reasoning paths”), despite recent claims to a more structural understanding of reasoning.
Unreal Plugin Integration
I’m working on a plugin for Unreal engine and, in the last 2 weeks, I’ve been looking for clever ways to inject my plugin’s data structures into the Unreal render passes without modifying Unreal’s source.
Using Claude code to scrape the UE source, which is largely undocumented, has been great for surfacing API’s and common usage patterns. This has sped up my work immensely.
However, it would often tell me there was no way to do something without modifying source, when in truth it was actually possible with some creative thinking.
Had I relied on Claude entirely here, I would have been forced to conclude I cannot ship my project as a plugin, which is wrong and would have significant business model consequences for our product.
Open VDB Transforms
Final relevant example: about 2 weeks ago, I was dealing with a non-trivial bug with Open VDB frame transforms.
I threw Claude Opus 4.7 at it and, despite having access to all the open VDB source, it hallucinated a bunch of stuff that didn’t work. I managed to figure it out in ~an hour.
Of course I’ve had Claude successfully spot bugs for me as well. But I’ve found the more complex the issue the less likely it is to figure it out; perhaps an obvious statement.
Conclusion
The discussion of the failures of LLM programming often centers around:
- lack of notable productivity increases in companies that have heavily adopted LLM coding
- challenges with code maintainability
- flawed unit economics of token costs
These are all valid critiques, but a more fundamental issue is the simple fact that LLM’s cannot do effective graphics programming autonomously, i.e. without close guidance, and thus the productivity improvements appear to me to be (currently) overstated.
Expert-level graphics skill is still required, both for boundary-pushing work and for run-of-the-mill tasks of intermediate complexity. How long that remains true is a mystery to us all, but given the current state of things I do not think we should assume we are within striking distance.
EDIT: wow this has gotten more traction than expected. I started writing this as a comment on another post but I’m glad I decided to post it for real instead.
Few things I wanted to address from the comments.
All of the above experiments were using agentic tools (claude code’s $20/mo tier in particular).
The stories I shared cover a somewhat wide range of usage patterns. The volume renderer experiment was more about seeing what a naive non-expert could build with LLM’s. On the other hand, the Open VDB bug was something I encountered in my day to day usage of the tools.
As written above: I agree that LLM’s can successfully complete “bite sized” tasks given the appropriate specs and an accurate description of the desired solution. I agree you could probably build an awesome renderer this way, maybe quite a bit faster than “by hand”. I do not consider this “LLM’s doing graphics programming”, at least in the way I meant it in the post title, because the expert graphics programmer is the one doing 90% of the substantive work.
Lastly: I use LLM’s to great benefit all the time. I am not anti-LLM coding. But I think we all ought to evaluate these systems honestly, with a high bar for correctness, and ask “when is it worth it to outsource work to a paid subscription service; what productivity improvement is required?“.
Thank you all for an interesting discussion!
EDIT #2: edited original post’s language for clarity and intent.
25
u/heyheyhey27 Jun 04 '26
As someone who spent a ton of time in that space, let me know if you still have open questions about it lol
Claude is really amazing IME at research. I don't ask it to implement a Vertex Factory, but to look at how it's implemented throughout the engine and summarize that info for me.
237
u/FirefighterAntique70 Jun 04 '26
This is pretty much an issue with LLMs in general. People like to differentiate between domains "LLMs can do Web dev perfectly,but it can't do quant or graphics programming"
LLMs can't properly reason about code in general. They look impressive to people who have never written anything substantial in their careers, but to those of us that have, it shows it's true colors.
Graphics APIs are very stateful, and LLMs are quite bad at understanding how the state of a value changes as the code flows. State makes any program much, much more difficult. Threads are stateful and syncing them is a notoriously difficult task.
I use AI in my IDE the same way I use auto complete from a language server, anything more and I feel like it writes the most disgusting code.
7
u/GeenzCat Jun 04 '26
Generally my experience has been for code as a whole that if you don't know what you're asking it to do, you should not really expect it to go above and beyond in any way other than cranking out something quick and cheap to demo. If you don't understand what the output is supposed to be or the mechanics of what you're trying to get it to do, it basically becomes a garbage in, garbage out situation.
And even when you do understand what you're asking it, and know what the output should be - it often gets a lot of basic stuff flat out wrong and rather confidently so. So really at best it's still glorified autocomplete that can write a lot of code that's subtly wrong very fast (and sometimes worse - just a dumpster fire of crap code), and not much else. And autocomplete you have to watch very closely, review very closely, and more often than not correct by hand if you want any hope of future maintainability. Or, you know, sign up for anger management classes as you yell at the damn thing over not understanding how a swap chain works.
4
u/GreenFox1505 Jun 04 '26
Didn't an Nvidia engineer vibe code a raytracer for Godot?
21
u/steveu33 Jun 04 '26
Claude is perfectly capable of working in graphics programming. You just can’t ask it to do too much in one step.
3
u/atrusfell Jun 04 '26
I’ve tried it and had a similar experience. It helped point me in the right direction on some things I hadn’t yet learned (mainly gave me the terminology I needed to search deeper myself), but once I learned those things through docs or other resources online I very quickly made less mistakes than Claude and found it faster and more painless to just work on my own.
I will give it points though for being very helpful for picking through obtuse documentation that is missing information. I imagine the wide breadth of sources it pulls from helps with this one
7
u/LBPPlayer7 Jun 04 '26
okay but question
what do you need to obfuscate a shader for?
2
u/Salt-Contribution-35 Jun 04 '26
Thank you so much for what you have shared, I was thinking on doing the same, vibe code with cloud, to convert GLSL to HLSL but I understand that It does not have the full capacity to find “smart ways” as you mentioned.
2
u/OptimisticMonkey2112 Jun 05 '26
Thanks for posting! I hope we continue to see more discussion around the pragmatic usefulness of AI. As we all know, there is a lot of hype that is often overblown and/or inaccurate.
And I totally agree with your sentiment about "the expert graphics programmer is the one doing 90% of the substantive work." I don't thing it is remotely possible to vibe code 3d graphics, at least with current tech.
That being said - I do think the tech is well worth the cost, at least for me. It is enabling me to accomplish things I could not do before simply because of time constraints.
I can leverage the agent as a "force multiplier", enabling me to do cooler stuff faster. I can delegate the time consuming minutiae to my AI minion.
Cheers!
2
u/ScrimpyCat Jun 06 '26
From what I’ve seen they can as long as you don’t care about the specifics/don’t hold it up to a certain level.
A friend that vibes (no coding background, does not look at or understand the code, does not know what techniques to use other than what they’ve learnt from playing games) has a lot of success with AI helping them make games. When I look at the code itself, it isn’t great, a mix of what I’d expect someone very junior to write mixed with mistakes I wouldn’t expect anybody to do (e.g. triple clamping values where 2 are completely redundant, branches that are never taken, etc.). But the results are really impressive (often performance issues in areas, and sometimes the odd bug still remains, but overall they work really well and have interesting visuals), and it’s interesting to see what rendering techniques the AI has implemented (for one 3D game it made its own SDF renderer, my friend didn’t request or know what SDFs are, but it fit because of the procedural art style they were going for). However they do sometimes completely abandon ideas because they have no luck getting the AI to do what they want. I’ll also add sometimes the AI writes in the code/tells them they’ve done something, but the code its implemented does not actually do the thing (at all, not that it’s just a broken implementation of it).
However my own attempts have been so utterly disappointing, to the point I can’t even understand the hype other developers give it. Don’t get me wrong, I think it’s very impressive what it’s able to do (even thought that back in the initial GPT 3.5 days), but I just don’t find it useful myself. For instance after solving some bug, I’ll sometimes check to see whether the AI could’ve done so, so I’ll give it the relevant snippets and not once has it even identified the relevant lines let alone why the code is problematic. e.g. I had a problem with my volume renderer rewrite that wasn’t there originally because I accidentally messed up one of the bit shifts when masking a value from a texture data sample, AI kept telling me that clearly the matrix transformation order was wrong, despite it not being wrong and the description of the bugged behaviour would not be due to that either. Other times I’ll feed it code I’ve written and ask it to explain it, it tends to get somewhat close but also gets a good amount wrong, though it does a better job than friends that have no prior knowledge of the domain (one exception to this is if they have reversing experience, they tend to fair much better).
Other times I’ve had friends (that have fully embraced agentic development) that believe AI is a multiplier, have tried to show me how AI could make me a lot more efficient. One time I was working on a cross platform SIMD implementation at the time so we used that. The first was as a code review, everything the AI said was fairly surface level and already stuff I factored in when deciding on the approach I did, but there was a lot the AI didn’t mention that you could also bring up with regards to the code. The second was having it copy my 64-bit width SIMD implementation (a small chunk of it since it’s a lot of code otherwise, also avoided including more “complicated” features like trig implementations) and provide a 128-bit width implementation. It completely neglected to use any of my helpers, and the SIMD code it generated was pretty naive, but if this was a group project I would be happy with it if it wasn’t for it failing the most important part, which was ensuring it is cross platform. It spilled platform specific API types into the function arguments/return types instead of using the opaque types that had been defined (it used them for the first one then just decided nope I’m going to randomly not use them from here on out), trying to get it to resolve this was a dead end. The third test was getting it to only translate the function declarations and documentation, for context my own solution was to write a quick script (10-15m) to generate it (important detail is this will also now work for any other bit width I need to support like 256, 512), meanwhile AI was still so far off even after an hour.
Now it’s worth noting that I’m not particularly interested in AI driven development in the first place. Having it do all the parts I enjoy is not interesting to me. So my own tests are mostly just to try understand where it’s at, or how to break it (the latter is what I focus more on). So I do expect a lot of my own testing to be flawed/a poor demonstration of its usefulness, but that’s where I would’ve expected friends that do use it all the time to have been able to produce more compelling results than they did. The same goes for when I watch people’s YouTube videos where they’re building a project, the whole efficiency aspect just seems very underwhelming.
10
u/Successful-Berry-315 Jun 04 '26
It surely can write Reddit posts though
5
u/heavy-minium Jun 04 '26
I did a lot in this area too and using screenshots are a big pitfall because it won't understand them as well as other types of pictures and makes lots of mistakes at interpreting the screenshots. And that's understandable because the training data doesn't have much that would pair a detailed textual description of a game debug scene with an image. So for example, let's say you're rendering a shaded wireframe so that the AI understands the topology of a mesh - it will fail at that. Same with UV visualization. Or yiu're trying to describe bugs with light and shadows - it will often fail too. That kind of stuff is barely there in the training data.
So in lack of driving instructions with screenshots, one need to describe things in painful detail with the correct terms for AI to understand the status quo and the target state you want to reach. This is why using LLMs for graphics programming is hard.
1
u/Buttons840 Jun 04 '26
Tangent: Why obfuscate HLSL instead of shipping SPIR-V binaries? There's no reason to obfuscate the source code if you don't ship the source code.
1
u/Successful-Trash-752 Jun 04 '26
Could it be related to the fact that you're trying to use newer technologies?
Try using c++ and opengl
1
u/ebonyseraphim Jun 05 '26
If you’re using an LLM to create a graphics engine, why aren’t you using an existing one? Avoid paying licensing fees? What are the token fees? What level of performance and capabilities do you even achieve?
1
u/Flashy_Editor6877 Jun 06 '26
GPUI was vibe coded
https://www.reddit.com/r/rust/comments/1tpjfaa/fact_gpui_was_vibe_coded/
1
u/Jolly-Ground-3722 Jun 06 '26
So you only tried Claude, not Codex with GPT-5.5 xhigh? This makes a huge difference in my experience, for some domains.
1
u/perelmanych Jul 27 '26
Thanks for the very interesting reading. Really wondering how your opinion has changed with recent launches of Fable 5 and especially Opus 5. Here is a video, where the guy does his usual tests with Opus 5. Look at the parts of "Subway FPS Test" and "UltraCode City Timeline Test". Comparing to results from previous models they look like from other planet.
3
u/_TheFalcon_ Jun 04 '26
from my experience with Claude Opus (4.5 to 4.7), Gemini pro (3 and 3.1), ChatGPT Codex (5.5), Opus has good reasoning, but leans toward tight smaller code, bad at coding in general (it reasons well, but its code is garbage), and it can't see the full picture which is necessaray for graphics programming (CPU to GPU, memory, etc..)
Gemini sees the full picture, but lacks reasoning, so it will think in the wrong direction and produce garbage (the worst)
Codex 5,5 has both, good reasoning, good code, it will do the job well, you can try it, it will do what you ask for. and it is not like Opus in terms of way of thinking, when I gave Opus a file of 10k lines it screamed (oh it is 10k lines), the way it thinks is kinda stupid and limiting for production code (specially in my case which is C++ and files tend to be huge in line count), on the other hand, chatGPT codex was editing a file and took some time, I didn't know why, but it produced good and correct results, so I checked the file to find out it was 45k lines of code LOL, asked it to refactor the file, it did refactor it to like 15-20 files each is 2-3k lines of code in less than 5 minutes with proper file names all .cpp extensions... so no, Opus is trash for production C++ applications which requires huge line count and connection between different types of data and memory like GPU programming
3
u/Deep_Ad1959 Jun 04 '26 edited Jun 04 '26
matches what i see: nails the cold-start scaffold, then can't iterate on anything stateful.
fwiw the cold-start-scaffold-then-stuck pattern is exactly what mk0r is built around, a thing I made that generates the full HTML/CSS/JS app from one sentence then lets you iterate on it with plain words, https://mk0r.com/r/bkf5ede9
1
u/Adobe_H8r Jun 04 '26
This doesn’t look like “AI is bad at [advanced technique]”— it’s “AI is bad at duplicating something it’s never seen before”.
Once you put your plugin code where AI can scan it, everyone’s AI will be able to do it too.
1
u/OptimisticMonkey2112 Jun 04 '26
My experience has been very different from yours. Not sure why you had so many issues.
Some things to check:
Using this I have added:
Sometimes stuff does not work right away and you have to work with it in the session.
a few times it even had to instrrument some custom logging, then it will build and run the program, and then it analyzed the logs to determine where it went wrong. Was crazy helpful to me.
If you undertstand Vulkan, it absolutely can function as a force multiplier. But I would definitely not try to Vibe Code graphics - lol that is insanity.
It is also a great tool to learn and explain Vulkan
I only mention this to help you realize that you might be able to adjust your approach for greater success... good luck!
1
u/eiffeloberon Jun 04 '26 edited Jun 04 '26
Skill issue i think, but claude is inferior to codex in graphics programming. What I do is I create specific implementation plans first, step by step implementation plans, and then I get it to implement it for me.
I wrote a path tracer completely with llm and didn't write a line of code myself, started with claude until claude made too many mistakes too frequently, then I switched to codex. It currently has these:
- rhi for vulkan and metal
- raster, hybrid, and wavefront path tracing mode with prefix sum compaction and sorting
- bluenoise ditthered sampling
- light bvh and worldspace restir di
- volumetric integrator with delta and ratio tracking
- dlss-rr and metalfx for vulkan and metal respectively
- hosek sky rendering
- procedural cloud rendering
- pytest for render image test
- and various other things
I also found that once I had image test, it could trigger the image test to continuously verify and fix its implementation, so that's another level-up. It can even go through the git revisions and execute the image tests to find which revision caused regression (although it should really run the tests each commit, but sometimes things leaked through). I would think the same can be applied for performance test/benchmarking and performance tuning.
4
u/RenderTargetView Jun 04 '26
My biggest problem rn is whenever I ask something about math the moment it finds out that I will be using it in shaders it goes all out on common subexpression optimizations that do nothing and make understanding formulas harder
2
u/JjyKs Jun 04 '26
Idk, I've been prototyping Vulkan based engine in C++ typing literally 0 code myself. Ofc I break down the problems and make sure that Claude follows good practices.
The engine is more of mimicking retro graphics so nothing groundbreaking modern mathematical stuff, but so far it has far exceeded my (bad) graphic programming abilities. I have quite long programming background, but doing something like this would've needed me to use premade engine before Claude.
https://youtu.be/OAoNtG0l5sA
4
u/OldChippy Jun 04 '26
I'm 165000 lines in to a Vulkan project. It can do almost everything I needed. Bug hunts fell back to me 4 times in the past year.
The biggest problem was me starting with my home grown math library the Claude was to refit to use on Vulkan. It was a simple ogl library I wrote 20 years ago. Clip plane s, right handed y up, etc, etc. endless options and places to fail. I dumped that moved to glm and 3 weeks of hell fixed in 2 days. The problem is that if an llm can see multiple junctures each spawning implications it gets lost around 3 steps in and blends in probability weighted answers with logically correct ones.
The solution here is lots of class separation, narrow focus in options then use architecture for context.
I work in architecture so this suits me anyway. But anyone vibe coding gets what the deserve. I build class by class, narrow focus, start with a problem space analysis the define interface based on integration.
Some people are the failure inputs the tool needs to churn out shit.
1
u/HyperspaceFrontier Jun 04 '26
AI is very good at some tasks and very bad at others. In general, using AI is a skill, combined with domain knowledge (software engineering for me) I am squeezing a good productivity boost. I always check that it did thing right and often it does not, but in summary it is still productivity boost and saving from a lot of manual boilerplate.
About tests - I generally agree, it is pretty bad at creating good test coverage. It funny, but I trust AI with tests even less than with other parts of code on average.
1
u/RyanCargan Jun 04 '26
For concurrent programming benchmarks in general for LLMs, this might be an interesting start.
1
u/mkawick Jun 04 '26
Even worse, try using LLMs for Unreal engine... nightmarish
1
u/osmanonreddit Jun 04 '26
My experience is completely different. Very happy with the results!
1
u/lukebitts Jun 04 '26
Vibe coding will always be a bust. If you judge a tool by its ability to read your mind you will never find value
1
u/FELIX-Zs Jun 04 '26
If you are able to obfuscate a shader code with an AI, similar AI can be used to reverse engineer it. "security by obscurity" more often fails
1
u/[deleted] Jun 04 '26 edited Jun 04 '26
You should be doing something wrong - I have been "vibecoding" a computer graphics CAD engine quite successfully for about 4 months now. I have been able to generate more than 200K lines of code, quite robust implementation of polyhedral bounded solid winged-edge representation capable of computing boolean operators (constructive solid geometry). Over the base model I can export STL files for 3D printing and I can also display interactive scenes in fully CPU, concurrent programmed (multi thread) CPU, OpenGL, Vulkan with raytracing and radiosity.
AI works super good for this. From rasterizing polygons to images, doing triangle meshes from polygons, handling interaction techniques with gizmos, augmented reality fiducial markers, GLSL shaders, texture management... lots and lots of things, super easy and super fast.
My approach is advancing step by step with a clear view on software architecture to grow under control. I download a .pdf with paper from ACM SIGGRAPH or a book. Let's say "Graphics Gems" series. I ask Claude or Codex to write a simple specific classes with related unit tests and an interactive testing program for visual debugging and next day advance in the next module.
I'm quite happy with that. Still some months before reaching commercial products such as Catia, Maya or Unreal Engine, but moving forward quite fast.
I wonder if you have tried creating detailed AGENTS.md file specific requirements such as what do you consider to be a good unit test. I wonder if you ask Opus or Sonnet in high effort mode just to write a plan in a .md file. Then you can switch to Haiku and write all the code burning less tokens.
In my experience, is very useful to implement an offline / headless mode in your program that instead of drawing in the screen exports your rendered scene to a .png file, because Claude can use that image as part of its gate / invariant condition. That way it will break less often.
Taka care on git use. Avoid allowing Claude to make commits, everything starts making a mess. Keep human in the loop and force AI to be formal, robust and 1:1 in sync with a paper.
If tests are not covering edge cases you can tell agent to use a coverage tool to make sure all logic branches are covered. If code is not optimized you can tell agent to use a profiler to gather data.
1
u/Hendo52 Jun 04 '26
You are right but there are mitigations. Start by having it write more detail in the requirements and specifications. Make it keep a diary of failed approaches and key architectural decisions. Split agents into specialised roles with skills files. Spend more time looping over the plan with a particular focus on surfacing and answering ambiguous questions before implementation. Spend a lot of effort on your validation and testing harness so that it’s never guessing but usually investigating prior work.
You are totally right that it’s not a one hit panacea. You are right that it’s often not very effective at things where you can tell the training data is not as strong.
The only part where I disagree with you is that I still feel like it’s a very valuable tool in this process, for debugging and planning, it just can’t replace the human entirely and in particular it struggles with what I think about as ‘strategy’ but that’s where I think it’s appropriate for the human to play their part.
1
u/Robert4di Jun 04 '26
Ask the language model itself:
Good at:
Dangerous:
In my experience, these still require domain expertise and careful review. The deeper you get into engine, rendering, threading, synchronization, memory management, or GPU debugging, the more obvious the limitations become.
My take:
AI is not a graphics programmer. It's a force multiplier for graphics programmers.
Or put differently: in graphics programming, AI is not the pilot it's a turbocharged screwdriver. Extremely useful, but if you hand it the entire aircraft, you may end up turning the landing gear into a shadow map.
1
u/EatingFiveBatteries Jun 04 '26
I find it works best when you go back and forth and create a clear, detailed plan to one specific thing. Or, if you have it modify an established codebase with strict coding standards in place. I've run into the same thing you have when it comes to things that need very abstract thinking or specific domain knowledge, and I think there's a path there to using AI meaningfully, but it requires a lot of set up and you will likely need to modify or optimize things still.
1
u/HayatoKongo Jun 05 '26
In my experience, using an LLM for graphics programming requires a lot more input data than you would require for web development. You should be giving a coding agent some kind of method for viewing the result of your rendering. There's also just way less training data for this domain than there is from full-stack web dev.
1
u/Dexterus Jun 05 '26
You need to know what you want and tell it what to do, while also trying to avoid generic requests where it will have a chance to go wild and break everything.
You also need to have info/examples to feed it. And instructions to match verbosity of surrounding code.
Keep piling instruction files.
They eventually work, I got it do be decent at writing clean assembly, asm/C random jumps. It still messes up comment verbosity occasionally.
But I do not dare just let it vibecode, lol. It doesn't get how things actually work and the theory you find online is too far removed from reality in close to the metal code.
1
u/stuaxo Jun 05 '26
Yeah they are pretty bad.
They get better when you can give them textual feedback, that's easier with web tech than graphics tech.
One problem is direction - though to be fair that can be a pain as a human too - the LLM only "knows" the text it's put in, not what the output is - so it's hardly surprising it gets things in the wrong location or direction.
Think about simple ways you can get your renderer to output something that can be measured and turned back into text to feed back into the LLM and you'll get further.
In general - do get them to add test... BUT (and it's a big one) - people tend to write bad tests and LLMs worse, so if it's only a general instruction the tests may not always be useful.
1
u/Ghost_Syth Jun 05 '26
Everyone be like LLM is good at this LLM is bad etc.. from my experience, it's been all over the place, one day it's good one day it's lost all its IQ, it's not even consistent day to day, I don't think we can draw the line on saying it's good or bad when we can't even have a unanimous experience as they keep tweaking the models capabilities, making it worst at peak times etc
1
u/anengineerandacat Jun 05 '26
Generally speaking I doubt it has the volume of training data to really do this.
Shaders specifically can get pretty unique, post screen effects it does actually do a pretty good job but that's mostly because these are standardized to specific terms.
I can have it create a bloom shader, vignette, scan lines, etc but that's because these are all pretty known and have plenty of public samples.
Most of the time though some graphical features are full on systems though; ie. Vegetation in a game.
It's not just a shader effect, it's often a procedural system and could even involve an asset processing pipeline if you wanted to say have vines or flowers attached to a 3D model without actually having to add that to the model manually.
Even something like a torch on wall can be complicated because it's yet again not just a single simple shader; it's an asset shader, particle system, particle shader, and a lighting system all in one.
There is some information on lighting systems but a lot of this information is heavy heavy IP that studios take to their graves.
Graphics and game development as a whole is like this; Blizzard isn't exactly going out there and going "this is how exactly we built World of Warcraft" and outlining in detail their architectural designs for some LLM to get trained on.
1
u/Inside-Brilliant4539 Jun 05 '26
I get it to write a lot of shaders reasonably well for me by giving it a repository of all my old core shaders that I’ve written in the past and if it’s a new effect. I explicitly define the algorithm with logic. I just don’t like declaring and typing all the brackets so that’s good enough for me
1
u/jaker3 Jun 05 '26
Title should be "I cant get LLMs to do graphics programming". Id recommend trying Codex. Its been a beast for me when it comes to this domain. A good test harness will go a long way too.
1
u/leseiden Jun 05 '26
Please inform my manager of this.
1
u/leosmi_ajutar Jun 06 '26
Zero problems here
1
u/LulzyAnimal Jun 06 '26
There's a really good video from Adrej Karpathy on how LLMs work, in particular about post training phase. It sets the expectations and understanding where their knowledge comes from and how you can leverage that. In case of graphic programming this basically means that the training in this area was insufficient. But! You can compensate that by driving the model by example, providing it snippets, from which it'll be able to generalized. It won't look magic, but it will work well enough. Also, Claude can suck when writing from scratch, but it can review much better. So if you write code in one session and then tell it to review/ find weak spots in another (so it doesn't have prior knowledge in ctx) you will get better results.
At the end of the day it's just a tool, knowing it's weak spots will allow you to get better results with it.
1
u/SirRaza97 Jun 07 '26
I saw this post and wanted to share my thoughts. I am not a graphics programmer and will not pretend to know the ins-and-outs but I did spend some time learning about the topic for my own curiosity.
I use AI day to day in my work. It’s been great at it and generally has made my life much easier. However I recently asked Claude to write me a shader for mimicking water caustics. I was completely disappointed in what it produced. It really highlighted where LLMs fall over. I’ve used it and seen so many amazing results for my day to day engineering job, but I was really surprised when I saw how bad a job it did when it came to writing, what I would consider, a simple shader.
1
u/BrainCurrent8276 Jun 09 '26
TLDR;
LLMs are actually pretty decent at graphics (3D).
1
u/latest_ali Jul 28 '26
Op did you have a chance to try fable and opus 5 for this? Has your option changed?
1
u/KlayEverHood Aug 19 '26
About “core graphics”: LLMs, and apparently some more than others, truly have still a hard time understanding a picture. One of these would try to convince me render was fine when it showed a big black hole in the middle. “Big black and middle” are quite easy to see and understand for a human, not for LLMs.
Then comes the tendency to “try desperately to fix it with patch on patch”. If left autonomous, even with well defined unit tests, LLMs can start piling up workaround on workaround for complex topics.
Solution to both issues seems to be that the architecture splits are made strict by separating in libraries with human choice, so that one good tested layer can be fixed in stone before moving on. Regarding testing and unit tests for graphics, often it’s much much more efficient to inspect the renders manually to spot issues. Even writing unit tests for LLMs on graphic concepts can be a huge waste of time, probably not much code to copy from
-5
u/Ok-Hotel-8551 Jun 04 '26
Skills issues
0
u/blackrack Jun 04 '26
Shhh don't let them know
-1
u/Jason13Official Jun 04 '26
Bro is trying to obfuscate shaders lmao
Yeah, the generalized AI is not good at a hyper specific discipline. Having worked with Claude to make shaders for a Minecraft mod though, maybe your initial approach was flawed. I ALWAYS start by giving a reference directory of known "good" code; i.e. vanilla core shaders.
I would doubt my tool if I used it wrong too.
0
u/EC36339 Jun 05 '26
I have used and am using LLMs for graphics programming, and the problems you are describing are not the problems I've seen and can easily be overcome.
One phrase in your post tells me everything about what went wrong: "when I looked at the code". I'm reading this as: You didn't, until it was too late. That's not a problem with LLMs. That's just bad engineering. It's like that guy who turned on cruise control on the highway and went into the back of his camper van. SurprisedPikachu.gif.
Here is a real reason why LLMs actually can't do graphics programming:
They write textbook code.
This makes them terrible at writing optimised shaders, among other things. The textbook methods work, and you can combine them to produce striking visual effects, but they will run slowly as hell. It's good for prototyping at best, seeing what something can look like. But not for production.
I needed a procedural explosion shader for my game. The vibe coded version looked OK, but it was a simple combination of raymarching with turbulence and noise (it started with value noise...eww!). It worked fine as a placeholder, but every time something exploded, my frame rate dropped. I have an old GTX 1080, but you would think it should at least be possible to render fast explosions on it somehow. It was a monster of a graphics card in 2018, and it runs Elden Ring at 60 FPS in max details.
Then I had a look around at ShaderToy. I found an explosion shader that looked absolutely gorgeous. The "noise" function was some esoteric combination of sine functions that you might not find in any book, and that was probably the result of hours and hours of trial and error, rather than a solid, physics based mathematical foundation. And it was fast. And that's exactly the kind of thing LLMs can't produce. They can steal such code, at best, when it is widely used and popular, so it appears in the model, or on the web. But an LLM can't invent tricks like that. Not yet, at least... Not without looking and interpreting and judging the visual output, which is a workflow issue, not an LLM issue, actually...
Fortunately, although I'm bad at shader programming, it's a craft that is rewarding and worth learning and doing by hand. For my project that's something to do when I'm out of AI credits. Vibe code something slow and ugly, so you have a placeholder and concept, then replace it with something fast and beautiful.
When it comes to math that runs on the CPU, I found that low level code optimisation matters a lot less than architecture. Build an engine that allows the CPU to vectorize operations and access data in a cache coherent way (e.g., ECS instead of OOP). Here, LLMs are quite good if you steer them in the right direction. Then have telemetry and profiling to do targeted optimisations. If you have to refactor the whole thing because it's garbage and a dead end, just start over from scratch, because LLMs do that fast.
0
u/Dahsauceboss Jun 07 '26
I'm using Claude Opus with great success to make a game engine
0
u/FreeLandscape3452 Jun 07 '26
I know nothing about graphics programming, but I have gotten claude to optimize a raymarch loop. What I always do is I tell it to like "Give me 5 ways to deal with this bug/optimize the DE/whatever bade description I give it", and I always tell it to explain to me why this will help before it updates any code. So, I am not capable of giving it a tight spec, but I can make it tighten the spec before saying go. Much of your post went over my head. I use claude for making FFGL plugins for visuals at raves.
-5
u/Effective_Lead8867 Jun 04 '26
for Unity:
i've vibe coded entire atmospherics pipeline inspired by rdr2 - clouds, volumetric and distant fog, minimal realtime SH probe gi (terrain bounce light, sky obscurrence), raymarched heightfield and cloud shadows
proper temporal accumulation, visually coherent, regularly profiling on steam deck
also vibe coded terrain, based on quadtree geometry, virtual texture data up to 256K vres (220fps on steam deck, MicroSplat surface shader)
for rust/bevy:
vibe coded port of NAADF voxel raymarching, noita clone, "voxel plugin" clone
taking from prototype to production takes time. i've developed methodology around it:
/delegate orchestration powers long sessions - orchestrator speaks to you, delegates work to architect(spec)/implementation groups that store context on disk. orchestrator has very limited (isolated) context supply. it has built-in circuit-breaks that terminate work if it hits a wall into /diagnose-first
/diagnose-first creates ranked hypothesis and produces visual diagnostic knobs and enums for you to determine and troubleshoot
/handoff (duh)
i do absolutely hate it for few reasons:
- its not a high quality codebase, i dont feel proud
- "almost works" is worse than being completely broken - sometimes troubleshooting an issue with ai takes more mental energy than I remember it was taking when I was writing code by hand
what matters most in agentic dev imo:
- ability for agent to iterate fast - unity -batchmode works better than any MCP
- e2e/integration testing that is designed around validity of results
- visual feedback under /diagnose-first and insights from a thinking human
- grounding decisions in body of research - i have more than 200 papers and /research skill that prepares high quality markdown from presentations, papers, slides, also /discover skill that can pull up citations
but I do feel like I'm learning the techniques I'm implementing with agentic dev by navigating the problemspace with Claude, which is important to me
-2
u/Gloomy-Status-9258 Jun 04 '26
I'm really glad when reading this kind of articles. People continue to find out evidences. It's becoming clear that LLMs cannot do coding(and other real-world tasks).
-8
u/Perfect-Campaign9551 Jun 04 '26
Don't use Claude for programming. Use Codex.
34
u/[deleted] Jun 04 '26
[removed] — view removed comment
0
u/[deleted] Jun 04 '26
[removed] — view removed comment
0
u/[deleted] Jun 04 '26
[deleted] — view deleted comment