No announcement yet.

Advanced Cel Shader Pack

  • Filter
  • Time
  • Show
Clear All
new posts

    That's a bug, I immediately released a fix but Epic processed the wrong update and I had to re-release it the next day and we're waiting on them to process that one as well. If you need to fix it in the meantime open the cel shader component and hook the index up to the name pin on the Create Dynamic Material nodes. The issue is simply that the materials are over-writing each other.

    The change from unitless to candelas is to stay in line with Epic, unfortunately they still haven't exposed the light unit to blueprints. I guess I should make up a pull request and get that badge.

    I suppose I should list the changes now you've jogged my memory:
    • Added LUT shading texture support. Create your own hard/soft/zany lighting gradient. See the demo character for examples.
    • Added support for a fourth light for complete blending coverage.
    • Shading model math updates.
    • Added new demo content


      Hi Antidamage , I'm using the free version of your shader, thanks! I noticed there is an update available.

      I made some changes to the master material, if I update what would I lose? Just, Master material or also the instances?

      Can we know what has changed?



        In general if you update you'll lose all custom changes you've made to default asset files.

        If you have to update: rename the cel shader folder in your project first and fix the redirectors before inserting the update, then at least you can bring your changes into the new version.

        As for what changed, there hasn't been an update. It might just be the UE version increment. You're safe to ignore it.
        Last edited by Antidamage; 04-07-2019, 05:48 AM.


          There is a small update coming to the Advanced Cel Shader Lite - version 3.

          Featuring a second outline layer (that we're calling an in-line) and per-object line colouration using a look-up table and the object's stencil value. Check the last room in the demo level for an example and a brief explanation of how to use it. Coming very soon.


            Hello...again. ^^

            I have a very dark interior cave environment, and I wanted to assign a different material at run-time, and/or change parameters on a dynamic material. However, it appears that doing either of these kind of kills the cel shading, and while I tried to invalidate lights, I can't get it working again. Is there any way to achieve this?


              You should be able to do that. Can you post or email me screenshots of how you're doing it? Is your initial setup working OK?

              In general you shouldn't need to invalidates the lights much, although it may help if you're spawning new lights to then notify anything with a cel-shader component. I'll have to check it to jog my memory but if I recall correctly it updates the light list frequently. The only thing I'd take note of is that you may want to spawn the lights with no illumination a few seconds early, then turn them on as needed so that there's no delay in enabling them.

              The material side of things is just a material, however you may need to re-initialize the cel shading component for that actor if you're swapping entire materials, as the reference to the dynamic material will no longer be valid. Just run the method CelShaderComponent->Constructor() after you change out the material. And let me know how you get on with that as I've just thought of a possible optimisation: if it doesn't do it already, consider clearing the Materials array as the first step in the constructor.
              Last edited by Antidamage; 05-21-2019, 07:14 AM.


                Ah, I need to do "Construction" again, you're right. Thank you! (It does sound like this approach would be very slow for per-frame modifications to the material, though...I was considering doing a raycast to see if the "whole character" was in shadow from the sun and darken the material, for a kind of "hacked shadow receiving"...)

                I am having a weird issue where point lights seem to be uniformly illuminating the entire character, regardless of direction of light...(I don't think this has anything to do with hot-swapping materials, though). Have you run into this before? (See GIF, light responsiveness is pretty high to just illustrate the problem)

                Last edited by IridiumStudios; 05-21-2019, 04:36 PM.


                  Check your material values. I forget the name of it, but one parameter should increase the back-fill effect of a light. Alternately, make sure your normals are all good. It won't be light-responsiveness, it could possibly be the specular value. It's phong specular, not UE specular, so it isn't anything to do with "shininess".

                  It's looking good otherwise though!


           doesn't seem to be specular. I opened up the Sample Project and this effect seems to exist there, too...there's a brighter side close to the light, but the barrel is uniformly colored red from a nearby red point light. I tried messing with everything but I couldn't get it to go away. Can you let me know what parameters I could change to eliminate the uniform coloring?

                    Attached Files


                      I'll take a look as there's an intentional backlight but you should have control over it.

                      Do you have a directional light present at all in the scene? Have you tried turning down the sun scaling value in the material?


                        I do, but messing with the sun scaling value (and even deleting the directional light) seemed to have no useful effect.


                          Any luck finding the appropriate parameters?


                            Actually, I was wondering if you'd updated the shader from the launcher recently. I just realised that you've taken a screenshot of an old asset.

                            However, I'm also seeing the same thing so I think it's an unintentional side effect of adding more supported lights. I'll fix it and upload an update soon, but it'll be for 4.22 only.

                            Edit again: I completely forgot what else I added to the shader. Check the Cel Shading Ramp LUT. That's what's causing all the extra light. Try importing your own so you can see how it works - it's effectively a dark-to-light shading gradient.
                            Last edited by Antidamage; 05-27-2019, 07:06 AM.


                              (I haven't upgraded because I made some custom modifications! And it was working great minus this one issue. I can update and re-modify if need be, however.)

                              Modifying the LUT with pure black on the left side does seem to fix the problem if the light intensity is just right, but the problem is that if the light is too bright, the light envelops the entire barrel, including backfaces, no matter what the light responsiveness/other parameters are. I might be able to get around this with clever values, but none of the light should be touching the backface of the barrel no matter how bright it is. See this GIF as I increase the light intensity from 10.0 to 100.0:

                              If I make the LUT mostly black to account for brighter lights not hitting backfaces, then I get this sort of effect for dimmer lights, which is silly:

                              I feel like the solution here is some kind of clamp in the CelLightingDirectional/PhongLighting function, on the normals, but I don't know enough about the math in there to do it.

                              More edit: after some deep diving, it appears that this part of the CelShadeRampSampler is causing the issue:

                              The output dot product is being shifted here from a -1 to 1 range to a 0 to 1 range for all values, making nothing "clampable". I'm gonna bypass that and see what happens...

                              Edit again: That...worked? I think!
                              Last edited by IridiumStudios; 05-27-2019, 03:09 PM.


                                There's two parameters - light responsiveness and master brightness. They're effectively the same thing and I should probably remove one of them. Try adjusting both of them down until it looks right. You're getting weird results though, for sure.

                                The range of the dot product should be 0-1 as it's simply a UV sampler, that's what the code you unhooked does. Whatever you're getting now isn't the intended result. The -1 to 1 will definitely cause the LUT to loop across the scope of the phong result, giving you light patches in parts that should be dark, or what you linked in the last image.

                                Is there any chance you can migrate the barrel, materials and light setup to a blank project and send it? I want to see what's going on there.