Is there a method to apply different materials to different camera types in Unreal Engine 5?

My goal with this is to use an unlit material that is only rendered by the scene capture camera, in all the meshes in the scene. Each one respectively having an instance of these materials.

The creation of the instance will be through the generation of a unique dynamic material for each mesh. I just need to know if it’s possible to have this running at the same time as the main camera

I’m not aware of a way to make a material different in scene captures compared to the main camera without engine modification. Might be possible in HLSL if there is a flag that the material can identify or you create one. There is a reflection capture switch that does this for reflection probes specifically, so that functionality could maybe be ported over to other captures.

But without such modification, the only way I can think of is to have a duplicate of every object overlapping. Then hide the regular one from the scene capture. This would be inefficient to do at a large scale, though.

1 Like

That’s what I thought. But basically the model having a similar copy of itself, would be the equivalent of the shadow extrusion meshe which would weigh a lot.

I have been following explanations of the creation of celshading. Typically they use channels such as roughness and metallic to transfer values in the Scene Texture. But at one point these slots get occupied.

So I thought about whether it would be ideal to create a render layer with an isolated material focused only on filter channels. Which would result in six extra channels:

Base color - R G B

roughness/mettalic/opacity.

This material would be isolated by custom depth, but at least it would need to be visible only to one camera and not affect the final render.

There are things in games as in the case of online modes where the player sees a different mesh for the rival player. One for the third person and one for you in the first person.

I don’t know how scene textures work, but they apparently get the result I’m looking for.

Would it be possible to create scene textures without having to mess with the engine code?