Unity's RenderTexture and Camera Replacement Shader analogy
I am fighting with some tricky and uncommon task and it seems i am stuck. I am trying to port solution from Unity which involves such features as
These features allow me to define custom camera, set specific shader to it and then render result to texture. 'Replacement Shader' can be used instead current shader (material) for each object on scene. It can take specific parameter from material - e.g. you can add material parameter FillColor=255. Current shader will skip it, but Replacement Shader will take it as argument.
So that we have: Usual camera which renders scene for user, second camera with same positioning but with Replacement Shader which renders to texture. In next step we analyze that texture and consider result in game logic.
Can you please help me to find analogy for UE4? How do you think that can be implemented using UE4? C++, HLSL, Blueprints - no matter.
I am looked to SceneCapture2D and RenderTarget but when i am trying to use them i see a lot drawbacks.
Scene renders second time, applying all materials, textures and lighting My shader in Unity quite simple and precise, if i want to render some object with FillColor=255 it does work. That i achieve now - is to apply some postprocessing to rendering result, and it is impossible to set FillColor=255 for object, because other effects from initial shader are also applied.
Thanks in advance.
UPD Following Krxtopher request - here is 'end result' that i need to achieve in UE4 (achieved in Unity and trying to port):
I need image which is captured from current camera view but with applying specific shader. All non-transparent objects on scene must be rendered as black areas (replacing all object pixels with black pixels) - except certain set of objects. Objects from this specific set are rendered with certain 'FillColor' parameter - all pixels are replaced with pixel of certain color (ideally 24 bit color). Transparent (or semi transparent objects) must not be rendered at all.
I want to be able to specify this color per object. And want to be sure that resulting image will contain only this 'specified' set of colors + black.
Follow this question
Once you sign in you will be able to subscribe for any updates here