Muse Chat struggling to give working shader code

One of the things I find ChatGPT most useful for is to write or modify shaders for me. It’s an area of game dev I’m pretty weak on. With ChatGPT 3.5 having only been trained up to 2021 some of its answers are out of date when it comes to Unity specifics. So I was hopeful that Muse Chat would be a great improvement. Sadly not.

My initial prompt was:
“Write a tri-planar object space shader that takes an albedo map with an alpha channel and a normal map. Include a parameter to alter the tiling. This is for URP 12.1.7”

The code I was given had a error:
Shader error in ‘Custom/TriplanarObjectSpace’: Surface shader Input structure needs INTERNAL_DATA for this WorldNormalVector or WorldReflectionVector usage at line 105 (on d3d11)

Muse tried again, this time no errors in the console but the shader asset shows an error “floating point division by zero” and when I create a material it is pink.

When prompted again it fixed that error but created the same error on another line.

At this point it gave up:
“I apologize for the issues you encountered with the provided shader code. I understand that the “floating point division by zero” error persists. In this case, I recommend referring to the Unity Documentation and forums to find a solution that works for your specific requirements.”

But I didn’t let it off the hook, I asked for a simpler version of the shader (to aboid the line with the floating point error): “Can you refactor the shader so that it doesn’t use a normal map?”
Got new code but although it gave no errors, the material using that shader was still pink.

I told Muse this and the response was:
"I appreciate your understanding. If the material appears pink, it might be due to the shader not being compatible with the Universal Render Pipeline (URP). In this case, I recommend creating a new URP-compatible shader using Unity’s ShaderLab language and Shader Graph.

Here’s a ShaderLab shader code that should work with URP"

Epic fail. I’d already told it the material was pink and I’d initially told it that I needed a URP compatible shader.

The next iteration had another code error so at that point I gave up and went to ChatGPT instead.

1 Like

Which unity version did you make muse try it on?

2021.3.16 LTS (with URP 12.1.7 as per the initial prompt)

Yeah. I’m using 2022.3 version and have the same issue