[UE5] Anime/Toon/Cel Shading Model (WORKS WITH LAUNCHER ENGINE VERSIONS)

Sorry for the ignorant question:
If I downloaded 5.4-Selshader and ran setup.bat and then GenerateProjectFiles.bat and compiled it, can I integrate 5.4-Selshader-LightBlendExperiment after all?
If I can, can you tell me a simple way?

just overwrite whatā€™s in your folder with the files from that branch and build the source again. if you already built it it should take less than 5 minutes because i only changed like 2 lines of C++ lol.

worse case it rebuilds the whole engine and you have to sit through that again.

1 Like

This is a really interesting lighting system. Thanks for sharing.

np :>

Sorry i have a noob question. Do the changes that you made to the engine code give Additional control over the Shader/material Graph or do they change the shading of every object globally?

And where should i start to learn more about visual coding? I havenā€™t looked at the source code yet but im afraid that i wouldnā€™t understand most of it
What are some keywords or subjects that i can search up for some potential guides?tutorials
Sorry for talking a lot

Iā€™m not really sure what you mean. My changes donā€™t change anything about the material graph, they change how unreal treats the output of material graphs, in this case by making your basecolour/customdata pins literal values that are displayed unmolested, and changes how lights blend together, in the experimental branch.

The way I think about it is making it closer to how one would paint a picture in a painting program.

On a technical level the way it works is you have 3 values youre passing along, red green and blue 0 to 1, and you use math to create the colours you want to appear. The rest simply comes down to practice and studying/reverse engineering other materials. Thereā€™s lots of free professional content by Epic on the marketplace, Iā€™d suggest you download some and study how their materials work, especially ones that do any kind of neat advanced effect beyond the usual basic diffuse+normal.

May I ask you about your model setup?
Iā€™m assuming they are all using lit materials and ā€œsimplyā€ have the Shader emulate the unlit shading style?

Unlit is just a shading model that ignores all lighting so, no, thatā€™s not really a good way of describing it.

Apologies if the question seemed offensive. I merely asked because after compiling your experimental branch and opening the example project (not the launcher one) I am greeted with this.

image

Having looked at your explanation of how the materials work, it seems correctly set-up by being default lit even though the custom data 0 and 1 pin are greyed out compared to your OP example.

image

Exploring the project fileā€™s settings I realized that auto exposure was turned on, so I simply assumed that it was intended for use with post processing volumes.

In this case, my I ask you for possible reasons as to why the source example project isnā€™t working with the 5.4 experimental source build out of the box? Iā€™d really like to experiment with your work.

Iā€™m pretty sure youā€™re using the wrong example project, use the one labeled launcher, not the unlabeled one.

Interesting. So the launcher example project is intended for both source and launcher builds? I assumed that, given that one modified the default lit and the other the clear coat that the difference in example projects would be the example material setup.

Yeah, when I made it I wasnā€™t planning to be touching the source again, but it became needed for supporting multiple lights. I havenā€™t updated the example project since that branch is still experimental.

Theyā€™re both still based on the same shader code changes. Thereā€™s just a couple C++ changes to change how light blending works.

Hey, thanks for sharing this! I have a question, is it possible to revert back to the original files without uninstalling and reinstalling the engine version? I have few other projects I work with and the team I work with them wouldnā€™t want anime shaders. Iā€™m thinking Iā€™d just copy and paste another version of UE5.4 for this but I already made the changes so, would reverting to old files revert everything back to original state of UE5.4?

just back up your shaders folder before you overwrite it, and then whenever you want to swap back switch their names around.

Alright thanks! Also, for some reason everything got extremely dark in UE editor after switching to your shaders, I also did the setup, is this normal?

Yes. Thatā€™s due to disabling the tonemapper so that it doesnā€™t remap all your colours to the values it thinks they should be. This means you actually get the colours that you input back out instead of having to eyeball it and guess. Disable SRGB in your diffuse textures, and redo your colours to the actual colour you want Unreal to output.

2 Likes

Hey there! Iā€™ve been following this post for a while now, and the only thing keeping me from using it has been the lack of functionality with multiple light sources and colored lights. I downloaded the experimental light blend branch, but I am unsure how to correctly use it as it seems to be the same as previous versions in regards to colored/multiple light sources.

You have to build that one from source, if you use it with the launcher build itll behave like the old versions. Also inverse square falloff has to be turned off on your lights, intensity set to 1 and unitless.

Thanks a lot! This seriously helped me out.

1 Like

5.5 Version is out. Multiple light support is in, all light types are supported (except skylight, because thatā€™s not actually a real light), and is fully featured in launcher versions without needing the source to be built.

See this post for light settings:

The [Specular Scale] setting controls how much effect the light has in shadows cast by it.

Iā€™ll have an updated example project up later, and hopefully a video showcasing everything once a certain showstopping bug involving skeletal meshes in 5.5 is fixed.

For any feedback/questions either post here or join my discord.

If you would like to support the project you can do so on Patreon here.

3 Likes