How to create a custom G-Buffer ?
In an other game engine I was able to work with a great feature that allowed me to render something in a specific render "layer". This allowed me to draw some meshes only in a specific render to texture and use this texture for some special cases in my shaders.
I would like to create a similar possibility in UE4 by creating a custom Render Buffer. Unfortunately I have no idea how or even where to look. Digging in the source code is a bit hard when you don't know what you are looking for.
So how do you create a custom Render Buffer ? :)
Start your search looking for the SceneCaptureComponent2D component and TextureRenderTarget2D.
If you look at the Blueprints example in the marketplace, there are security cameras that have SceneCaptureComponent2Ds attached that capture the scene/process it to a TextureRenderTarget2D, and then you are able to use that TextureRenderTarget2D as a texture in other shaders/post processes/etc.
Some documentation on the security camera setup is here: https://docs.unrealengine.com/latest/INT/Resources/Showcases/BlueprintExamples/SecurityDoor/index.html , although it's probably best to dive in and play with it in the editor.
This isn't exactly a 'custom G-Buffer', but a custom render target for only drawing certain items to sounds more the direction you're headed?
answered Apr 23 '14 at 05:23 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here