Are we not allowed to code shaders anymore?

I find it increasingly difficult to code shaders in HLSL or GLSL. Seems like only ShaderGraph is going to be supported, and just barely as a large number of nodes are totally broken in 2022 when using HDRP with Path-Tracing.

So, this must be a really dumb question, but is all shader creation dumbed down to the Shadergraph now?

I mean, the Shadergraph is horrible to work with if you actually know how to code shaders. it takes forever to make a shader that can be coded using a few lines of actual code. And, to make any innovative complex shaders like on www.shadertoy.com now seems impossible.

I did make a shadergraph shader and chose to look at its generated code to see if I could extend it, but just showing the generated code took like 30 minutes and there was millions of lines of code with all kinds of obscure references that it is nearly impossible to extend with custom hand coded code.

Am I missing something obvious here, or is Unity now only going to be for non-coders who doesnt know how to code shaders, leaving the rest of us with almost no freedom compared to before?

I’m sure this works for a lot of people, but it absolutely cripples innovation if you want to do something different from the beaten path. And Shadergraph shaders also tend to be much slower than hand coded optimized shaders.

If I am missing something obvious here, I would love to see a hand coded shader example for HDRP Path Tracing in 2022v, because I am lost on how to make one myself. Anyone with a concrete sample for this, please let me know, thanks.

They are currently working on better text based shader support I think:
https://portal.productboard.com/unity/1-unity-platform-rendering-visual-effects/c/1375-block-shaders-surface-shaders-replacement?utm_medium=social&utm_source=portal_share

Thanks, but I found zero information there on how to code a path tracer compatible HDRP shader.

I suggest providing feedback on the roadmap I just sent and maybe make a bug report if something doesn’t do what it should?

I’m not familiar with hdrp sadly, so no clue how the support it (but heard it’s a mess)

According to this thread, the answer seems to be maybe:

Ah, thanks for the link, and based on that it looks like Unity will only care about shadergraph from now on, despite the community asking for custom coding support.

Well, I can accept this, IF the shadergraph actually works. But sadly, it is not even close to working when PT is enabled. And I need PT to generate high quality pre-rendered cutscenes.

Out of frustration I went to Unreal 5, and found custom shaders with PT is working 100% there, they also have a really good workflow for making PT based cutscene rendering.

Seems I am forced to port my project to UE5 instead then, which is a ton of work as I have a large number of scripts in C# that is hard to convert to UE. But I cannot sit on my hands and wait for Unity to maybe make this work sometime at an unspecified point in time in the future.

This is how I understand it (I don’t have much experience with HDRP yet, unfortunately):
You can still make custom shaders but there is no longer any support for surface shaders and making lit shaders without shader graph is difficult and undocumented.

However, lit shaders are for rasterization anyways, not raytracing. Realtime path tracing is still in its infancy, so there is no surprise that Unity doesn’t have that. Unity is a game engine for realtime rendering. Offline ray tracing is usually done in tools like Maya or Blender. Games usually only use raytracing for certain effects like shadows, reflections or AO.

Having said that, you should be able to write your own raytracing or path tracing shaders but it’s a lot of work.

1 Like

Nono, the Path Tracing is not for real time gaming, it is for pre-rendering cutscenes that is of higher quality, this is very convenient you see, when you want to use the game mechanics and assets in those cutscenes, rather than rebuild the scenes entirely again in a dedicated rendering program.

Epic understands this, they got a really good Path Tracer going on that is tied up to a recording system. There everything just works, no pink shaders or crazy weird compatibility stuff depending on what rendering pipeline you choose. in Unity it seems we are depending on blind luck if a feature is properly implemented or not.

Dont get me wrong, I love that Unity does have a PT, super important. But, it really makes things hard for anyone trying to make AAA titles when they only do it half-way, and the work becomes an seemingly endless series of weird workarounds to compensate, rather than focusing on creative tasks. The whole purpose of a game engine is to take responsibility of those nitty gritty things, so that we can put efforts into what makes our games unique. HDRP in general is really hard to work with, often it feels like it’s just a tech preview thrown together randomly, and not actually intended for real life use.

My company is now seriously considering porting everything over to Unreal Engine 5. Which is a pity, it take a lot of extra work to port all the code over. But so does the constant workarounds and unforeseen limitations.