Understanding the Purpose and Benefits of Accessing Unreal Engine’s Render Hardware Interface (RHI) in Compiled Builds

Hello everyone,

I have an important question regarding Unreal Engine’s rendering architecture. As I understand, Unreal Engine uses an interface called RHI (Render Hardware Interface) which acts as a middle layer between the user and the underlying Graphics API (like DirectX, Vulkan, or Metal). This abstraction means that developers don’t need to call functions of each specific Graphics API directly. Instead, depending on the target platform, the engine handles rendering and related tasks through RHI during the build output.

My question is: why exactly is it possible to access RHI? What is the benefit of having access to this interface? More specifically, what can be done with RHI access when using the compiled version of Unreal Engine from Epic Games without modifying the engine source code?

I want to understand what kinds of operations or customizations are feasible through RHI in this context. If anyone has experience or knowledge about practical uses of accessing RHI in a compiled Unreal Engine environment, I would really appreciate your insights.

Thank you in advance for your help!

Hey there @montazeran123! I can’t speak for too many practical implementations for developers outside of those who have some special requirements. Most don’t “access” the RHI in the traditional sense. The engine level RHI access is mostly for changing the RHI targets, adjusting some of the features in an easier way than trying to modify them directly in a source build, and debugging utilities built in to help determine issues with with the interface. While there is more you could do, it’s usually relegated to niche situations.

1 Like

Hello @SupportiveEntity! Thank you for your response. I have a few limitations with Unreal Engine 4 that prompted this question:

  1. Custom Static Mesh Rendering: I want a static mesh to be rendered only in specific passes (DepthPass, BasePass, CustomDepth). In the material options, there is a “Disable Depth Test” setting, but it’s not available for Blend Modes Opaque and Masked. My idea is to remove the Depth Pass for the static mesh and instead use CustomDepth depending on the situation to control Depth Testing.
    I’ve seen explanations about this in the Mesh Drawing Pipeline section of the documentation, but I need guidance on how to implement this practically.

  2. Accessing and Clearing the Depth Buffer: I want to clear the depth buffer before drawing certain static meshes (like a weapon) so that it doesn’t clip through walls or surrounding objects. Is there a way to access and clear the depth buffer in UE4?

  3. Adding Billboards to Static Meshes: Someone told me that by combining Material Billboards with static meshes, I can add billboards at higher LODs (e.g., LOD2) without heavy calculations in the material editor (WPO input), There are many examples and tutorials on forums and YouTube about this—has anyone tried this approach?

  4. Accessing CustomDepth in Opaque and Masked Materials: It’s quite strange—everyone I asked said it’s not possible. But I think it would be great if we could access CustomDepth in Masked materials at least.

Maybe I’m approaching these issues from a misunderstanding of UE4’s capabilities. If so, I’d appreciate any guidance so I can fully utilize Unreal Engine 4’s potential.

Thanks!

@SupportiveEntity

Apologies, looks like the original reply slipped through the notification cracks. I’m more focused on surface level engine mechanics, so I can’t confidently say much about the rendering core outside of my short excursions into it, though some of these can be done (or there is a workaround) without modifying the source.

  1. and 4. Unfortunately you can’t easily “remove” an opaque mesh from the standard Depth Pass without making it non-opaque ( for example translucent) or modifying engine source code. It’s also not easy to use CustomDepth here, as it’d need source edits. If possible, I’d lean into other non-opaque material types and just not utilize the transparency when it comes to needing custom depth and stencils. A skilled engine developer could probably get it working, but it may be more complicated than I expect.

  2. Without source edits, from what I can tell, the way the depth buffer is setup, it can’t be cleared mid operation as it would break rendering for everything that comes after the object. Though I’m no expert on that topic. Most users tend to either using Render After DOF or using Scene Captures.

Render after DOF method:

Scene Capture Method:

  1. Unreal actually has a built in imposter system just for this, and it’s usually what I recommend using over self rolled systems, but if you wanted to handle it yourself, you can still use the ImposterUVs material node to WPO to handle to orientation instead of handling WPO yourself. A plane’s WPO is really light, so I believe the performance requirements there are quite low.

https://dev.epicgames.com/documentation/en-us/unreal-engine/render-3d-imposter-sprites?application_version=4.27

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

1 Like

Hello, @SupportiveEntity

First of all, thank you very much for your helpful guidance and for sharing that great video which really helped me address the issue. I truly appreciate your support. :heart:

I was wondering if you happen to know anyone who could assist me in better understanding the rendering, materials, and post-process sections? I’m looking for someone with experience who can help clarify these topics.

Also, regarding 3D Imposters, I have read about them in the Unreal Engine documentation before, but I haven’t been able to find any tutorials or practical guides on how to effectively use this feature. If you know of any good resources or tutorials that explain how to properly utilize 3D Imposters, I would be very grateful if you could share them with me.

Thanks again for your time and help!