Full Screen Post Processing in code?

Hi,

I have a very simple question. Does anyone have an example of implementing a full screen shader effect IN CODE / HLSL or some UE4 derivative? I am coming from DX and OpenGL background, where i’d render the scene to an off screen buffer texture, and run a simple quad vertex shader and then do my thing in the pixel shader.

The more I am exposed the visual side of UE4 the more i am being converted… so perhaps i just need to bite the bullet, but at the moment I have an idea for quite a complex effect that will require a lot of inputs and just feels easier in code.

A code example of full screen grayscale effect or similar would be enough to set me down the correct path. I would assume it would be creating a post process material in code, and then adding it to a post process volume.

Maybe i missed something in the documentation but always seems to do it visually…
thanks!

You can write custom code in HLSL and use that in a Material Shader if that helps you at all? Unfortunately however you’ll have to write the code in a regular text-editor then paste it into the Custom nodes’ entry box, because currently no code pop-up comes up like it did in UE3. See (slightly outdated) info here: Custom Expressions | Unreal Engine Documentation

There are however some built-in post-processing techniques that are applied in code, like Fringe Effects, Vignette etc. Where they actually exist in the source code I’m not sure (you’ll need source code to make those kinds of changes), somewhere in the ‘Shaders’ folder I’m assuming!

What you’d have to do in that case though is either modify the Camera, or modify the PostProcessVolume actors to access your code. That’s why using HLSL in Materials is probably easier :slight_smile:

Thanks for your response, very useful to know the lay of the land.

just took a closer look at it. think should be workable. thanks again!

Sure thing! Let us know how you get on :slight_smile: