Make the engine more accommodating for custom shading models

Unreal currently requires changes to the C++ source code files to do the trivial process of adding material pins and enabling the CustomData GBuffer. I’m not an engine programmer/C++ expert/etc but surely there has to be a better way to expose this stuff to users so they don’t have to change 5 lines of code and then waste hours compiling the engine.

All the actual rendering logic occurs in the USF/USH files and you can modify these no problem on launcher builds, you just can’t enable/add material pins or GBuffers. Why can’t new shading models and their respective additional pins be setup via project settings, or plugins, or some dummy Custom shading models added to the shading model list by default with both CustomData pins and the Custom Data GBuffer enabled?

This is a feature that has been requested for nearly a decade, and this is currently the highest voted feedback thread. Can we get some kind of official response on this please?

2 Likes

This is a feature that is needed for many non-pbr workflows. Support for custom shading models without needing to modify and compile the engine would be awesome!

1 Like

Yes please, in the past I had to compile UE 4.24.3 from source just to add a basic Shading Model for cel shading. I shouldn’t have to do this to get access to lighting & shadow data. Having to use a post process is bad.

2 Likes

This would be a very nice addition to the engine

There’d be no more bad post processing alternatives or a 200 GB fork of the engine source code with long compile times

Hi,

The goal of the new Strata tech is to achieve this, details can be found here:

Thanks,
Jon

Can you go into more detail what this is going to accomplish relevant to custom shading models? I’ve already experimented with strata and read your article and haven’t seen anything showing its relevance to this issue.

3 Likes

It doesn’t seem that relevant, as it’s a layering system for existing shading models.
We want to have the ability to make custom shading models for stylization/non-pbr-ness

I think the goal with Strata is to first introduce it in Production, then work towards a way to allow more shader customization. In short, we won’t be getting any accommodation for NPR until much later down the road.

When examining Strata demonstrations, it looked a bit like Blender’s Shader Editor, which made me a bit excited.

Also, refactoring done for Strata may have introduced a severe performance issue with UE 5.1 :rofl: :Shader Instructions 2-3 times more in 5.1

omfg lmao

I actually popped open the shader complexity viewmode in my project a few days ago and was wondering why everything including unlit materials was red, I figured I just broke it with my shading model but I guess not :rofl:

leaving a comment to signal the need for a “non realistic” shading model that is flexible. A toon shader in unreal without editing engine code is near impossible and requires hard work arounds. Post process is not ideal and is very inconsistent, material shader only wont have self shadowing and no toon point light support. Would be a huge help if unreal team could provide a flexible toon shader that perhaps supports bands, dir lights, point lights etc out of the box. Really not in the motivation to learn HSLS D: or like mentioned above provide easier tools to do so. I am not too interested in shaders. I studied source code of forks, however its not my area of interest. For Unity I was able to buy really robust stylized shaders. Not everyone wants to download a 250gb source file to change lighting behaviour.

2 Likes

I don’t think Epic Games is going to make support for stylized rendering better any time soon. It’s looking like they’ll make it worse with each iteration.

The amount of work that Arc System Works put in to customizing and describing their stylized techniques for Guilty Gear Xrd back in 2013 for UE3 haven’t lead to much changes to UE itself. That development pretty much fell on deaf ears, or rather, because UE customization is hard enough, nobody else replicated what Arc System Works did in Production, so you don’t see a lot of highly-stylized/anime-style games/entertainment made with UE.

2 Likes

Big +1 upvote on this. Lack of access to creation of simple NPR shaders is a big blocker for VFX.

1 Like

Gonna +1 upvote this.

Strata is mostly just useful for multi-layered materials with existing BSDFs currently, and from what I’ve seen, it’s post-process option is quite limited in regards to functionality. I’ve seen my fair share of people trying to say “Just use Strata” while not really understanding it’s use-case scenarios.

Post-processing has it’s issues, especially in regards to how flawed the Scene Color / Diffuse solution is, weird visual inconsistencies (like reflections not working properly), and those effects not being flexible on a per-surface material basis (I.E: If I want a texture map that dictates the base shading color for each portion of the surface material before any extra lights get added).

Unlit materials have some limitations (I.E: no shadow casting, needing to fake reflections via cubemap textures, etc), and while forward shading allows you to more easily access the necessary lighting information, third-party plugins for this functionality stopped being updated, on top of being unable to have raytracing or any Unreal Engine 5 specific rendering features. Last time I checked, using GPU lightmass to compile lighting doesn’t work when the forward renderer is being used either.

Unity (Yes, even with HDRP and raytracing) and Godot have been way more flexible in regards to custom shaders, and this is one massive area (that has seemingly been neglected for years) where I think Unreal needs some work for me to consider using it again.

2 Likes

I wonder if since the C++ engine code changes required are mostly changes to the material editor if this feature will come with a material editor update down the road some day. I think having custom shading models would be so awesome for Unreal and could really make it even more powerful of an engine than it already is

1 Like

For anime style graphics, if not Unreal, which engine are you using then?
I supposed either Unity or Godot, right?

1 Like

I was using Unity for a bit and messing around with Godot as a side thing, but now that Unreal has fixed a few things keeping me from using the engine (alongside community plugins for stuff like C# support), I guess I’m back using that again. The problem I found with Godot is that it automatically handles blending, which means I haven’t had much luck doing things like manually specifying the shading color for certain parts of the material.

I definitely like how directional light and specular information is now more easily accessible through the material editor, but yeah, the engine still needs better support for shading models. Strata materials seems like a good step into the right direction (Because you can pick the BSDF model to use from there), and there’s now the option to selectively forward shade objects, but the problem still is lighting information.

Figured out how the reply system works and I messed it up a few times, so apologies for the two “(Post deleted by author)” posts.

+1

This would be a very useful feature. Adding custom shading models should be possible without having to recompile the entire engine! Please consider this for future releases. Thank you!

+100500

Strata is a good step forward, but it’s still not allowing to add custom models normally.
All the BSDF stuff is hidden inside the engine, it’s not even possible to add a new model via a plugin.

And hacky ways such as overriding the base shaders from a plugin, requires a lot of effort with migrating the whole patches to each engine version.

I wonder how possible it could be to effectively create a Blueprints component that abuses the render target system (With depth buffers) to essentially create a new shadow mapping system, which could then be used inside of unlit materials to have shadows cast onto them. Granted, that won’t take advantage of raytracing or Unreal’s new shadow system, but at least the way that I see it, it would be a good compromise for the time being until there’s massive overhauls to Unreal Engine’s strata system. If you think about it, directional lights are essentially cameras that use depth buffer information to effectively fake a light being there.

It looks like it’s been achieved before, but you kind of have to piece together how things were done:

How to blur a custom shadow map?

Shadow Map Material Function

Forward rendering specific materials could be an option (Apparently that is a feature that strata can do), but you can’t access any sort of lighting information via that. Couldn’t one essentially do a deferred shading pass first, somehow save the lighting information, and then use parts of the lighting information in a forward shaded context?

Just trying to brainstorm ways on how we can figure out the problem of no shadow mapping under the current engine limitations.