The shader code in version 4.20 has been greatly changed.
It takes some consideration to reintegrate existing code.
One of the biggest differences: you can no longer see the variable NoL explicitly.
My model looks perfect if I choose unlit shading and choose Emissive Color, but then the shadows don’t affect my character. Is there a way I can obtain the same style with toon shader? I already downloaded it but I’m trying stuff at random, don’t really understand and it works.
I was looking to add effect to my current project. I’m not currently using as a post process, but would love to get working by editing the code. Would anyone be willing to teach me how to add to my project as I’m fairly new to source code editing stuff.
Thanks
I am considering integrating the functionality of’s original implementation into one or two files by modifying the clearcoat shading model.
will result in the loss of the clearcoat shading model, but it will save the inconvenience of modifying C++ and recompiling.
Tell me if you are interested.
That’d be great! I don’t think anyone would need both toon shading and clear coat in one project anyway! If you need test or any support let us know!
The problem is that whether it’d be convenient to support mobile platform, as I see’s original implementation have some modifications for mobile forward rendering pipeline.
I would definitely like to see that. To be honest, I refresh thread every few days, hoping for something like that to make the process of updating engine versions easier. I’m currently using a build of 4.19 with shader. However, I’m building a VR project and would love native Windows Mixed Reality support. So, for that plugin, I’m faced with the need to migrate to 4.21 pretty soon.
I would tremendously appreciate it you posted a simple way to get the toon shader working in newer versions (even if it were just a clearly written instructional). Thanks, by the way, for all your posts on topic. They’ve been quite informative.
The only reason the Toon Shading model can’t be used under forward shading is that it uses GBuffer.CustomData. Simply replacing the CustomData with a fixed value will make the Toon Shading model work.
topic has a new reply on average for a few days. I think is why Toon Shading for UE4 is slow to develop.
So I hope to promote shading model by making it easier for more people to use it.
I think I managed to make work in 4.20 (I am in a 4.20.2 source build). Seems like 4.19 to 4.20, the lighting was refactored, so it took me some diffing between versions to situate myself. But I think it works looking at my screenshot.
Well, the picture is a little confusing. Are the face edges on the cylinder brought by toon shading, or are they not in the same smooth group in the model to begin with? Toon shading doesn’t mean you see all the face edges like those in low poly style games. It’s still smooth, but has stepped lighting, like cartoon.
I just discovered a really simple Cel Shading approach that doesn’t require any line of code to be modified.
method is suitable for all Shading Models except hair, and is suitable for all types of light (other types of light other than directional light can only be used as fill light).
Can be used for forward rendering, for dynamic objects, and partially for static objects.
The reflection is not very good, please increase the roughness or reduce the specular highlights.
@IOchair
Thanks for posting . It’s really clean.
How might you change the limit to something other than NoL .5?
Also, how would you go about changing the hue of the shaded area?
The color of the shaded area appears to be completely dependent on the base color. (Emissive has no effect)
is simple, giving B of the if function a value other than 0.
In addition, if you want a soft transition, you can also set the normal as follows:
Normal = VertexNormal + NoL * _softScale * LightVec;
Set the shading model to two sided foilage, and then you can control the shadow color separately by subsurface color.
The effect is limited, but it does work.