Fixing Wrong Scene Size in Unreal 4.19+

I'd like to thank Tisanim for pointing out the problem that occurs with some post-processing materials in UE 4.19+, due to multiple viewport sizes. While the post-processing material works fine in game, it can be rather inconvenient to work with in the editor.

Problem


As you can see in the image, there is a black edge that we'd like to get rid of. The solution can be found in Sharper image post-processing material by Hallatore, but I'd like to place it here for convenience.

Solution 

Solution lies in using viewport texture coordinates rather than texture coordinates described in previous blogs. You can get them by creating your own custom node and pasting the following code:

  return GetDefaultSceneTextureUV(Parameters, 14);

Furthermore the Custom Node, should return Float2 in order to work.

The Oil Paint effect can then be rewired as follows:


Where SceneUV contains the code above.

Comments

Popular Posts