testing pt 2 4/5

After last week I have a list of things I want to add to the shader before I compile it into one, that being 
  • better line definition/edge preservation.
  • color sampling and redistribution
  • the player character to be masked out of the shader
    The first thing I'll try to tackle is the edge definition, it's already supposed to be built into the Kuwahara filter with the Sobel function but I don't notice a strong difference when it's applied. I was recommended to try convolution instead. 
    Convolution already exists in Unreal engine as a method of computing bloom, it's a lighting setting. 
based on how the Sobel function was used, I probably can create a custom node in Unreal and copy-paste the convolution formula into it. I am not doing this right now, full transparency it is above my skill level so I will come back to it later when I have a better understanding of implementing functions. 

Cel Shader

    Alternatively, I started working on a cel shader to see if that would positively affect
line definition.



    Version one of the cel shader uses different value sets to determine where the "line" on the object is, ranging from white as the most intense point of light and black, areas with no light. 
The resulting effects are really subtle. 
Unreal Base
Cel Shader
Paint Shader
Cel & Paint

Cel, Paint,
and Kuwahara filter

    This isn't as strong of an effect as desired but there's definitely a difference, but I think I've created a new issue. the cel shader succeeds in creating edge definition by darkening the whole image. Now I feel like this can be fixed either in the value thresholds for the cel shader or in my next step when I create something to control the color. 
    Also, I can just change the base lighting so the shadows aren't as dark.

Color Shader 
    My thought process for how I want color to be manipulated in the scene is that in traditional painting, there are little flecks of color in seemingly random places that match the color in other objects. Color is also harmonious, so there will need to be something to unify the palette. extra attributes that are just nice to have as a material setting would be saturation/vibrancy and a hue shift. 
    To achieve randomness I attempted to sample the scene texture with a Perlin noise filter




    The noise adds a nice randomness, but it essentially does the same thing as the paint shader, it warps the scene projection based on a texture (the noise). What I need is a way to mask out certain small patches of it so it looks like random blobs of paint. I haven't found any documentation that aligns with what I'm trying to describe, so I'm not sure if it can be done. 
    I did however manage to add a color overlay/tint. So if someone wants the scene to be blue-toned or red-toned they can do that. 

Sources


Comments