Normal materials in Unreal engine can have multiple different functions and parameters, this is because the output material has multiple inputs. a post-process material does not. So I'm approaching this similar to how the Kuwahara filter was built, I've converted the separate materials into material functions, which then get called by a new material. inside the new material, there's still a compatibility issue so I use the float 3 to float 4 nodes to convert all of the functions to a float 4, making them compatible with each other. this is where I get stuck,.
when I add the functions together the effects are broken and the final image is black and white. the add node changes the final value of the function, undoing any progress I've made. this issue happens for all other "combiner" (math) nodes, multiple, lerp, etc, because they they all influence the value. The color change is happening somewhere in the conversion from float 3 to 4 because the image is still black and white if I connect the float directly to the emissive input.
 |
the result of adding a converted edge and paint function
The closest I've come to getting the original result was using a blend overlay to combine the functions, which works the same as Photoshops layer blending.  | | combined functions using blend. |
By multiplying both functions by the scene texture, the color is restored, but because this uses a blend mode, its darkened.
Multiplying the overlay and the texture will cause an arithmetic error (I'm not sure why, as both functions are float 4) |
While this result is super cool and moody, it's not working. Blending the paint texture and edge definitions results in a paint texture that sticks to edge outlines, which
can work, it's just not what I'm trying to achieve here. the darkness issue is super prominent here too, I have the sun in this shot turned up 10 times the normal amount and it looks like nighttime. Turning it up further darkens the sky and highlights the objects. Setting it to 0 will fix the sky but black out the objects in the scene.
I'm just playing with the various blend modes now, this is the result of a soft light blend, it gives some nifty rainbow highlights. I think my best option is to use multiple materials on one post-process volume, it gives the best visuals so far. I'm thinking though there has to be a way to control the luminosity or brightness of the materials, to nip this darkness issue.
Something else I've noticed is that the edge definition trembles. this does not happen when I have the edge turned on by itself, so this material is probably a little resource-intensive on the engine renderer.
In addition to all that I've started working on masking the player from the post-process effect, which the whole of the internet believes can not be done. Except for like two people, who gave very vague information on how to achieve it. My understanding is that in the post-process material, add a blank material, that has no effect on it and set it to 0, like this.
Then in the object you want to hide's render settings, turn on render custom depth pass, and turn off render main pass, then set the customer depth value to zero, this hypothetically, should put the object on the same depth layer as the blank post process, but it just turn the object completely black. If I can find an alternative I can always just switch to a first-person character.
So, there are 2 weeks left of this class, and I'm pretty happy with what this turned out to be, I want to keep tweaking the compiled material to see how close I can get to the desired effect, but I've eased off of this a little to start on a small environment that I can use this on as well as documenting how to implement this shader into projects for other people to use. My hope is by week 10 I'll have this uploaded somewhere for people to download and a nice portfolio piece.
Sources
Comments
Post a Comment