Advanced Cel Shader Pack

I don’t reply to these too much, But I remember reading that someone had a similar issue with UE4 ver 4.20.3 but not with 4.18.3, I haven’t read or heard anything on 4.21.2 in concern to the issue. I know with 4.20.3 if I’m making a material and say the values for a color switch are too far apart from one another instead of going from color to color it goes black in between the switch, but if I move them closer together, it doesn’t happen and goes from color to color smoothly with no black. I’m not sure of this kind of display between a range of color(s) would effect what your doing. thought I’d mention it… hope this helped.

I just checked with 4.21 and without grading. Its the same.

I’ve put a possible improvement in place.

Before:

After:

The main issue is that there will always be a tiny amount of bleed at some angles on flat surfaces due to how it works.

The fix had the net effect of lightening the scene as well, which may be desirable in the bigger picture, since obviously you don’t want the outline darkening the whole screen.

If this is acceptable I’ll add a bleed reduction parameter back into the shader.

I think it looks better :wink: If i can ask, i would love to know how to redo it.

It’s a pretty simple change but it’s better if I do it as an update. I’ll get it out tonight!

Okay, thanks :smiley:

Hey, ! Really enjoying the pack, including the V2 where I can get those cool custom shadow textures.

One big thing is exclusion, though (notably on dense foliage). While this is clearly a feature of the original CelShader, it seems to be absent on V2. Is there any way to achieve exclusion?

Also, when setting up a material descended from MAT_Cel Material, it seems like things don’t work if a static mesh requires 2 or more materials; only the first one ends up being properly shaded. Can anything be done about this?

Also had trouble finding any real documentation on the website…am I missing a link? There are some intro tutorials, but that’s it. I’d love to know what all the parameters do.

Exclusions are enabled by default now, you can’t turn them off in the shader settings.

I forget if it’s written down somewhere, but enable Custom Depth Buffer With Stencil in your project settings and then use Render Custom Depth and stencils 0 or 1.

0 still causes the object to draw an outline, 1 turns both detail shading and the outline off (or vice versa). For some objects it’s a bit hard to set that up. For foliage I believe you have to directly edit the foliage type, not the world-spawned foliage ISM actor.

A usage I expect to be common is to use the cel lighting model on interactive object and characters, with stencil 0 and the exclusion behaviour reversed so that only the cel lit objects are outlined (this is how the demo reel videos have been shown so far).

The cel lighting component will work on multiple materials, make sure you hit play-in-editor to allow the component to run if you’re previewing it.

Thanks for the tips, sir! I’ll get back to you if I need any further assistance. Thanks for the great product and quick reply!

One more thing: it looks like the outline thickness varies as you vary the size of the editor viewport? Is there a way to mitigate this, and if not, will the thickness of the outlines change upon setting different resolutions in the standalone client?

The outline thickness is scaled relative to 1080p. So if you’re running it on a 4k screen and set the outline to 2, it’ll display as 4. I need to check that v2 still does this though, but I can make it optional.

The editor viewport is a very strange beast and the size the shader thinks it is isn’t always the size it is. Anything involving editor viewport size is not to be trusted. For that reason it may preview strangely.

The speed with which you reply is insane. Hats off for that.

In theory I’d love a resolution independent option, but no rush. I can always change the parameter in the material instance based on the ratio of the current resolution to 1080p, it’s just a little extra work.

Thanks again!

Hehe cheers.

Open up the CelshaderV2 master material and go all the way to the left and unhook the UV input. That should do it.

There’s nothing plugged into the UV input on the far left:

https://forums.unrealengine.com/filedata/fetch?filedataid=157194&type=thumb

I unhooked this “screen size line scaler” input and replaced it with 1. Didn’t seem to do anything in the editor, but I assume that’ll fix it in the standalone?

https://forums.unrealengine.com/filedata/fetch?filedataid=157193&type=thumb

That’s what I thought. You’re probably seeing editor viewport weirdness then. Try a packaged build.

Gahhhhh. I thought I was all good, but I keep noticing things! Sorry to keep bothering you. You’re great!

Are shadows not supported on cel-shaded materials on a skeletal mesh? I only just noticed this. Shadows seem to work fine on static meshes, but they’re nowhere to be found on skeletal. The following GIF has two objects with identical materials.

https://www.dropbox.com/s/f2bx3nktfr…adows.gif?dl=0

Upon further inspection, skeletal meshes with a cel material seem to neither cast nor receive shadows. I don’t necessarily need receive, but cast is pretty important to ground the player.

That’s right, cel-lit materials are unlit by UE, so cast no shadows.

Try creating a copy of your skeletal mesh and assign it the same animation blueprint. Then mark it as “visible”, “hidden in game” and “cast shadows as hidden”.

I suspect your static mesh is not a cel-lit material instance or the lighting property in the instance is overridden, so it’s casting a shadow

I really thought I was good there for a minute! But alas, another issue arose!

I’ve been messing with the cel material (no post process) in a basic scene with a directional light, but as I began to build out a more complex environment, I suddenly realized that the cel material did not in any way react to point lights. I know it’s supposed to, because your video with the cel-shaded character in the long hallway clearly reacted to the torches appropriately.

I tested this in a blank project with a fresh import, no modifications. Material instances descending from MAT_CelMaterial do not in any way react to point lights. I know it’s supposed to gather the four closest lights, but it definitely isn’t. Is this a bug, or am I missing something? :frowning:

Also, looking at the sample pirate scene, the BP_Barrels…presumably cel-lit…cast shadows on the ground? But I thought it was unlit?

I’m very confused. :frowning:

Edit: Even adding a point light to the scene and hitting play is currently given errors. See second photo.

Did you change the lighting type to unitless? This is discussed in the videos. You want a value of around 2000-10000 units. Values of 10-20 candelas or lumens won’t produce a noticeable effect (unit type isn’t exposed to blueprints).

However, be aware that in the next patch the unit type is changing to candelas.

Reasonably certain, though I won’t be able to check until Sunday morning. Why would those errors appear in the demo scene upon adding a point light…?