Camera ideas & Clean up 8&9

 The last big issue with the shader is how the player is rendered. the paint effects and blurring makes the player character get lost in the background. 

yuck

    The way I'm trying to fix this is by rendering the player on a different camera than the background. what I'm seeing from UE documentation is to use a custom depth buffer, but I haven't gotten that to work. I'm honestly kicking myself a little bit because if you go back to week 3/4 and look at the paint shader tutorial I have linked, they show exactly how to do that. (screaming, crying) I should have watched the full video. 

    But before we backtrack, let's go over some optimization stuff. In attempting to make multiple cameras render out a composite, I learned that you can add the post-process materials directly to the camera, illuminating a need for the volumes at all. there's nothing wrong with using a volume, but by adding the materials to the camera, there's no chance of missing a section of your world, the filter is always applied to where the camera is looking, not the physical space it covers. if you open the player characters blueprint, you can select the camera from the viewport menu, under components, there you can tweak your camera settings (or add another camera if you need that for some reason) and add your materials. Under post-processing, then rendering features you can add array elements and plug in the post-process instances. 

SO...

in order to mask an object from a post-process effect, you need to set the custom depth buffer on the object. to do this go into the objects render settings and tick custom depth. then, inside the material you want to mask it from create two scene texture nodes, set one of them to custom depth and the other to scene depth, then subtract the custom depth from the scene depth then run it through a clamp node, and poof, the object is out of the scene. 

Literally, it just turns black. From here we need to bring the object back, as well as the rest of the world. depth buffers are set to a numerical value, since I only have 2 it's a 1 and a 0, the clamp assigned either a 1 or 0 to the outcome of subtracting the depths (0 since the default is 1), so what we're seeing here isn't an image, it's an alpha mask that will tell the post process effect what to render. anything white gets the effect, anything black doesn't. back in the material editor run the clamped value through a mask, R is fine, then connect this to the alpha of a linear lerp node, the a value gets connected to a scene texture without any special effects, and the b value connects the material we built. the output of the lerp gets put into the emissive color. 
the node tree should look like this

So when everything gets plugged back in, the effect gets masked! Currently, there is a mask on the Kuwahara, the paint, and the color (however that doesn't seem to be working). 


Bad news, this didn't fix my issue. When I cycle through the shaders it looks like the issue is coming from the edge definition.


Up close everything is working as intended. I turned down some settings on the edge material and it looks a little better, if I need to I can always mask the player out from the material, or move the camera closer. 

Lastly!

An environment to test it on. It's not done, but it's getting there. 

SO, by next week I want to have the environment fully fleshed out,  and the shaders imported in so I can render some cool shots, then I want to shift focus to packaging up the shaders for other people to use, which means cleaning up the scene, I already deleted some repetitive stuff that wasn't needed, and making something to show how it's used, then what platforms I can upload these to, like artstation or gumroad, maybe UE marketplace if possible.

References

depth buffers


Comments