Announcement

Collapse
No announcement yet.

[WIP] Anime/Toon Stylized Shading Model

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    TAA is pretty nice for certain effects, maked dither and whatnot, hair cards, there's also settings to control the TAA I saw in a quixel video
    https://www.justtodosomethingbad.com.../7/skunk-works
    my next attempt at anime type shading will probbaly be based off this

    Leave a comment:


  • replied
    Originally posted by Shmoopy1701 View Post
    Wow this looks great.
    :>

    Originally posted by YuuJin View Post
    reporting that this build doesn't work with raytracing
    https://forums.unrealengine.com/unre...aytracing-4-23
    probably because this ? it's not set to render with forward

    would have been nice to have these features with raytraced accurate shadows
    Disappointing but not exactly surprising. Unfortunately the deferred rendering anti aliasing "solutions" are just so awful that I've got very little interest in putting effort into figuring out how to do this in that pipeline, but then again the forward renderer and msaa seem kinda doomed given the glaring issues they've faced for years that Epic doesn't seem interested in moving on, so I may have to make the switch someday anyway.

    vOv
    Last edited by Envieous; 07-25-2020, 11:40 AM.

    Leave a comment:


  • replied
    reporting that this build doesn't work with raytracing
    https://forums.unrealengine.com/unre...aytracing-4-23
    probably because this ? it's not set to render with forward

    would have been nice to have these features with raytraced accurate shadows

    Leave a comment:


  • replied
    Wow this looks great.

    Leave a comment:


  • replied
    I've added support for controlling shadows on DBuffer Decals in the same fashion as regular geometry.



    For now it works by hijacking the Shadow Range, Spec, and Roughness pins and using them as the shadow r, g, and b values respectively.

    Leave a comment:


  • replied
    Updated OP with an example project, and better instructions for how to start, and some more examples. :>

    Leave a comment:


  • replied
    I've stopped hijacking the existing customdata pins and made new dedicated ones for Shadow Colour and Properties. This should mean that this plays nicely with all the existing shading models, but the focus of this change was to make the subsurface shading model work with my existing changes. Here's how it looks on my character's skin.

    Right is with subsurface scattering, left is without.



    There's a few minor changes that I made to make it fit my style. One, it only affects shadowed areas, surfaces that aren't in shadow are unaffected. Two, I amplified the result a bit to make it work well with 1.0 intensity lights.

    Enjoy :>
    Last edited by Envieous; 06-26-2020, 01:20 PM.

    Leave a comment:


  • replied
    Small change: the red channel of shadow properties now controls the range of dynamic shadows, while shadow range controls the light vector portion of shadows. While this won't do anything special with the actual shadow data (eg: blur hard shadows), it does give a bit more control since while light vector shadows are always a nice smooth gradient dynamic shadows can be all over the place.

    Leave a comment:


  • replied
    it's pretty simple, just gotta make sure you have all the visual studio components you need installed and you're pretty much good to go. gl

    Leave a comment:


  • replied
    I have an RTX card
    but I don't really know how to build an engine, I'll take a crack at it at some point

    Leave a comment:


  • replied
    Originally posted by YuuJin View Post
    this is pretty cool
    can you control self shadow and casted color separately in the shader?
    :>

    Shadow colour is set in the material, so yes, just make the shadow colour value different for the self shadowing object, and whatever object is receiving the casted shadow.



    Originally posted by YuuJin View Post
    and do you think it would work with raytracing turned on?
    https://github.com/unity3d-jp/Raytra...~/README_EN.md
    like this one in unity?
    Raytraced shadows are something I have a lot of interest in implementing since Unreal's default shadows for anything that isn't a directional light are just so... bad, but unfortunately I don't have 600$ to blow on an rtx card at the moment. While it's possible it works as is, it'd take someone with raytracing capable hardware to fire this up and find out to tell for sure.
    Last edited by Envieous; 05-14-2020, 07:37 PM.

    Leave a comment:


  • replied
    this is pretty cool
    can you control self shadow and casted color separately in the shader?

    and do you think it would work with raytracing turned on?
    https://github.com/unity3d-jp/Raytra...~/README_EN.md
    like this one in unity?

    Leave a comment:


  • replied
    Originally posted by KingKrouch View Post
    Thanks for telling me that. Regarding what I was saying earlier, I was referring to some sort of way to do unlit-esque shading that is the reverse of what you have for the shading scalar (think of instead of a scalar to remove dynamic shadows from the shading, which I believe you are using for faces, have some sort of way to only have dynamic shadows), but can still accept dynamic shadows. Such a feature would be useful for making hand-painted areas that can still have objects cast dynamic shadows onto it.
    I still don't think I understand what you're asking, can you post a picture?

    All that scalar does is remove the true dynamic shadows while leaving the "fake" light vector shadows alone, doing the opposite doesn't really accomplish anything useful (though you could by having a vector offset value that pushes that gradient up enough that it's always >1.

    Unreal creates dynamic shadows by merging a simple light direction vs surface normal calculation and true dynamic shadows. All that's accomplished by removing the light direction component is that you lose normal map detail, and end up with ugly bumpy shadows because the dynamic shadows aren't entirely accurate so Unreal merges in the light direction component to mask that.



    Originally posted by KingKrouch View Post
    Something else that I noticed with the materials is that UE4's own ambient occlusion isn't completely disabled with the toon shader, which leads to objects looking like they are lit regularly in shaded areas, as opposed to being flat like cel-shading. Perhaps there's a way to expose both UE4's own Ambient Occlusion and a custom node just for Toon Ambient Occlusion, so there's more control over this?
    If you're talking about SSAO that's controlled through the post process which runs after the shader so isn't within its control afaik.
    Last edited by Envieous; 05-13-2020, 11:00 PM.

    Leave a comment:


  • replied
    Originally posted by Envieous View Post
    I'm not sure what you mean?

    Point/Spot lights work, but you have to turn off inverse square falloff in their settings (idk why). Their behavior is different than what you might expect though as they're not longer additive, but rather max instead.
    Thanks for telling me that. Regarding what I was saying earlier, I was referring to some sort of way to do unlit-esque shading that is the reverse of what you have for the shading scalar (think of instead of a scalar to remove dynamic shadows from the shading, which I believe you are using for faces, have some sort of way to only have dynamic shadows), but can still accept dynamic shadows. Such a feature would be useful for making hand-painted areas that can still have objects cast dynamic shadows onto it.

    Something else that I noticed with the materials is that UE4's own ambient occlusion isn't completely disabled with the toon shader, which leads to objects looking like they are lit regularly in shaded areas, as opposed to being flat like cel-shading. Perhaps there's a way to expose both UE4's own Ambient Occlusion and a custom node just for Toon Ambient Occlusion, so there's more control over this?

    Leave a comment:


  • replied
    Originally posted by KingKrouch View Post
    So far, this shading model looks great in 4.25. I really love the option to change shading color altogether, as it gives more flexibility. That, and the shadow range and properties options are great to see.

    One thing specifically is how the default lit shading model is replaced with the toon shader. This causes some noticeable issues (such as the white shading that you mentioned, plus everything using toon shading). I think that having toon shading as it's own seperate shading model would be VERY helpful. Maybe for the default shading, have it multiply the base color by a fixed shading color unless overwritten in the shading texture area.
    :>

    I'll get around to implementing it properly alongside Default lit eventually, probably the next time I burn out on art because those are good times for me to just dig into technical stuff like this and I don't feel bad about sitting there for hours letting things compile.

    Originally posted by KingKrouch View Post
    The second (Although a bit off-topic), would be a shading model that emulates unlit, but allows only shadows to be casted onto the material, as opposed to having full shading. This would be great for environments with hand-painted textures.
    I'm not sure what you mean?

    Originally posted by KingKrouch View Post
    Support for point-lights (as currently, they don't work altogether, which would be useful for things like muzzleflashes and other kinds of dynamic lighting). Specularity also doesn't seem to work (Some sort of way to customize it would be great). It also looks like lighting channels don't work with this toon shader either (Which would be useful for characters having their own lighting vector, while still being able to cast shadows).
    Point/Spot lights work, but you have to turn off inverse square falloff in their settings (idk why). Their behavior is different than what you might expect though as they're not longer additive, but rather max instead.



    Lighting channels work as expected.



    I made no changes to specular because outside of reflections on certain materials it's always set to 0 for me, and because there's not really a one size fits all specular formula I could implement that would suit everybody's needs. However the reason I did shadow colour as a value that gets passed straight to the shader unmodified rather than multiplied was so specular formulas could be done in the material editor itself (I do this on the lamps in the above picture). The downside is that light positions being available to the material by default is lost, but they can always be inserted relatively painlessly into the material manually if you have a manageable amount of lights and they're really needed.
    Last edited by Envieous; 05-11-2020, 09:40 PM.

    Leave a comment:

Working...
X