Toon shading model

Is there any possibility of you porting the toon shader model to 4.14?

I will port it to 4.14 in next 1 or 2 weeks. (If it’s not already been ported by someone else by then)

Hello (maybe is my question for Nate
) :slight_smile:

I’m not a C++ guy at all. But I did try to install your shader anyway because it seams so good !
I pass a lot of time on understanding how to do .
I think some other potential users will need a mini guide, even if I get stuck near the end of the process, I have no doubt : Together, we’ll figure it out ;).

I’m trying to install and compile the editor with your code. Here’s what I’ve did so far :

VS2015 open itself with the UE4 project loaded.

Then I follow guide : Building Unreal Engine from Source | Unreal Engine 5.3 Documentation :

  • I’ve no problem to build UE4 from the sources I’ve downloaded.
  • But then I try to launch the editor (Debug -> Start new instance), I’ve got a message saying :
  • I click on yes, it compile a bit again and launch the editor.
  • after operation, I see the spash screen of EU editor (still at 0%)
  • UE4 triggers a breakpoint (I continue anyway
), 2 times and crash.

In the log, I can see a lot of different lines with kind of things (with different dll file) :

I work with a win 8.1 64bit machine and verify the settings twice. I compile for 64bit.
I don’t know what’s a PDB file but these are not fatal errors.
Here’s the real problem :

(the full log is in attachment to post :slight_smile: )

What did I miss ?
You can talk to me like as you’ll do with a child, I’m such a noob here :slight_smile:

@JoGoiA,
It seems I forgot to checkin “ToonShading.usf” in my 4.12-toon branch. You can get it from 4.13-toon branch: https://github.com/marynate/UnrealEngine/blob/4.13-toon/Engine/Shaders/ToonShading.usf, save it into your Engine/Shaders folder of 4.12 source tree, then run the editor (no rebuild needed).

Nice! One of the conceptions I believe needs to change a bit in Unreal users is that it is “so easy” to get a nice realistic looking that most games in Unreal end up looking kinda similar. And that’s really bad, especially for indies. Of course that the tools already allow us to do basically everything we want to, but most people get too comfortable in what’s just out of the box. We need more solutions like widely available! Congratz and thanks for sharing =)

@Nate
Thanks a lot ! I put the ToonShading.usf file you link in the “engine/shader” folder.
From now, I can resume my “narrative playthrought” :wink: :

  • 
 launch the editor (Debug -> Start new instance)
  • the splash screen of the editor is showing.
  • at 45 %, it’s stuck for a looong time while it compile all the shaders (I imagine it’s normal and happens only the first time I launch the new version of the editor).
  • at 95 %, UE4 triggers a breakpoint (I continue anyway
), 2 times and crash.

here’s the new errors :

(Full log in attachments).

  • I found the ConsoleVariables.ini and uncomment the line : r.ShaderDevelopmentMode=1, as suggest by the log.
  • Now, when the editor is loading, at 95 %, a big windows named “error” opens with the same 40 shader compiler errors.
  • In that case, UE4 editor doesn’t crash but get stuck at 95 %. The only one process consuming processor resource is something called “ScriptedSandbox64.exe”

@JoGoiA, it seems the “ToonShading.usf” you downloaded is bad. (when download file from github, make sure click “Raw” button first, then save as
)
I attached the “ToonShading.usf” here, extract it into Engine/Shaders folder.

btw, enabling ‘r.ShaderDevelopmentMode’ will increase shader compile time, it’s best to leave it commented.

ToonShading.zip (702 Bytes)

Yes !
You did it, @Nate !
Thanks a lot for your devoted help :slight_smile:
It’s time for me to annoy you again with another problem ^^.
(it’s certainly off topic, do not hesitate to kick me from post)

I create a copy of my project and try to open it but

I use 2 plugins (Wwise and Neofur) and they are incompatible with my new UE 4.12 editor.

Is there something to do about that or am I screwed ?
I can’t work without them


I think that’s just a version check problem because these 2 plugins aren’t affect by the changes made by the toon shader (I imagine, maybe Neofur is
)

@JoGoiA, glad to help :slight_smile:

There’s 2 kind of UE editor. One you downloaded from Launcher : Pre-build; One you build from github source: Custom-build.

Usually code plugin is compiled against Pre-build editor (e.g. marketplace plugins), and wont works out of box in Source-build editor. For code plugin works in Souce-build editor, you need to build it yourself (assuming those plugins do come with source).

To build code plugin with github source, you need to place those plugin either into Engine\Plugins folder or YOUR_PROJECT\Plugins folder, then rebuild the Engine or Project.

Got it ^^
I’ve got access to Wwise sources but neofur sources are a bit expensive for us

We need to think and make a choice :slight_smile:

Anyway ! Thanks for your help Nate and for your shader, Arnage.

Will you port it within the next few days? Doesn’t seem to be anyone else who will port it. :o

@shahrizai, will do week. poke me if i forget :0)

@Nate

I tried to port it myself yesterday but I think they changed up some things after adding forward shading in 4.14.

I get an error:


Failed to compile global shader FTiledDeferredLightingCS1 Line 986 in GlobalShader.cpp

Which is piece of code:


UE_LOG(LogShaders, Fatal, TEXT("Failed to compile global shader %s %s %s.  Enable 'r.ShaderDevelopmentMode' in ConsoleVariables.ini for retries."),
			GlobalShaderType->GetName(),
			Pipeline ? TEXT("for pipeline") : TEXT(""),
			Pipeline ? Pipeline->GetName() : TEXT(""));

Anyone managed to port to 4.14? :slight_smile:

How has not been pulled yet? It has been mentioned on the stream at least 2 times and it seems to be a very nice addition with virtually no downsides.

Is there anything we can do to help make happen? or is there another problem? (them having problems implementing it because of some bug or something like that)

4.14 port: https://github.com/marynate/UnrealEngine/tree/4.14-toon

Thanks Nate, you’re the best!

Btw, does Epic write any patch notes about changes to shading models? I noticed that some stuff have been moved around to other files and some parts of the shading models needs new types of definitions like the:


Add(FGuid(0xD3C17C26, 0x0B4F4B9F, 0x9DECBAA3, 0x0EF88128), TEXT("ToonStepSize"),		MP_CustomData2, MCT_Float1, FVector4(.1,0,0,0), SF_Pixel);

I’m trying to learn how to be able to port the shading model to new versions myself, but Epic keeps changing the way shading models are built, so it gets confusing to find all the changes.

Any insight would be appreciated:)

Is the plugin system still too limited to make as a plugin?

Hi all!
I tried to make a toon shading model as in tutorial. http://blog.felixkate.net/2016/05/22/adding-a-custom-shading-model-1/
But changes in .usf files in the new versions of the engine is too large.

So I found topic and tried to explore toon shader in https://github.com/marynate/UnrealEngine/tree/4.14-toon

It really works great. But I would like to get adjust the tone color of the shadow.
My knowledge is not enough to carry out it myself.

and it would be good to be able to adjust the size of the flare separated from reflections on the material environment.

and if somebody know - why Epic Games officially will not add any model toon shading?

How to disable reflections?
http://image.prntscr.com/image/45d5eb70dc874841ba2ee8af9c954a43.jpeg