Skip to content
TheChatArchiveThe Chat Archive
Metallama-3.3-70b-instruct· MetaHugging Face LMArena Human Preference 140K

In UE5, I have two cubes placed against each other such that two faces are touching.…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-3-7-sonnet-20250219-thinking-32k’s answer.
  1. User

    In UE5, I have two cubes placed against each other such that two faces are touching. They both have translucent materials and render correctly independently. However, their touching interior faces can be seen through the other faces, creating an undesirable artifact in the middle. Enabling backface culling doesn't fix it, because the further cube's interior face is front-facing. How can this be addressed?

  2. Meta Assistant

    The issue you're encountering is known as "depth fighting" or "Z-fighting" when dealing with opaque objects, but in your case, it's more related to the way translucent materials are rendered. Since both cubes have translucent materials, the engine is trying to render them in a way that respects their transparency, which can lead to the interior faces being visible through the exterior faces.

    To address this issue in Unreal Engine 5 (UE5), you can try the following approaches:

    1. Use a Small Offset: You can try to slightly offset one of the cubes away from the other. This can be a very small distance, almost imperceptible, but enough to prevent the engine from trying to render the interior faces of one cube through the exterior faces of the other. This method is simple but might not be suitable if the cubes need to be perfectly aligned.

    2. Custom Depth Write: For translucent materials, you can control how they interact with the depth buffer. By default, translucent materials do not write to the depth buffer to allow for proper blending. However, you can experiment with enabling "Custom Depth Write" in the material settings and adjusting the depth write properties. This might help in controlling how the depth of your translucent objects is handled, potentially reducing the visibility of the interior faces.

    3. Material Setup: Ensure that your translucent materials are set up correctly. Sometimes, tweaking the material properties such as the "Blend Mode" (e.g., trying "Alpha Blend" or "Additive" if appropriate), or adjusting the opacity and color settings, can affect how the material is rendered in relation to other objects.

    4. Use a Masked Material: If one face of the cube doesn't need to be translucent (for example, if it's always going to be against another cube), you could use a masked material for that face. A masked material can be set to be opaque, which would prevent the interior face from being visible through the exterior face of the adjacent cube.

    5. Cull Obstructed: Though you mentioned backface culling didn't solve the issue, there's another culling option in some material settings called "Cull Obstructed" or similar, which might help in certain scenarios by culling pixels that are determined to be obstructed from view by other geometry.

    6. Manual Geometry Editing: If the cubes are static and their positions are known, you could manually edit the geometry to remove or adjust the faces that are causing the issue. This could involve merging the two cubes into a single mesh and removing the interior faces or adjusting them so they are not visible.

    7. Use a Different Rendering Approach: Depending on your scene and requirements, you might consider using a different rendering approach for these specific objects, such as using a mesh with an opacity mask or other techniques that allow for more control over how the geometry is rendered.

    Remember, the best approach can depend on the specifics of your scene, the requirements of your project, and the performance considerations. Experimenting with different methods and evaluating their impact on both visual quality and performance is key to finding the right solution.

  3. User

    Where can I find the "Cull Obstructed" setting in UE5?

  4. Meta Assistant

    The "Cull Obstructed" setting is not a standard feature in Unreal Engine 5 (UE5) that can be easily found in the material editor or the details panel of an object. My previous mention of "Cull Obstructed" was an error, as this is not a built-in setting in UE5.

    However, UE5 does offer various culling options and techniques that can help optimize rendering and potentially address issues related to obstructed geometry. Here are a few places where you can find related settings:

    1. Material Editor: In the Material Editor, you can find settings related to culling under the "Material Options" or "Material Properties" section, depending on the material type. For example, you can enable or disable "Two-Sided" rendering, which affects how the material is rendered on both sides of a mesh.

    2. Details Panel of a Mesh Component: When selecting a Mesh Component in the World Outliner, you can find settings related to culling in the Details panel. For example, under the "Rendering" section, you can find options like "Cast Shadow" and "Cast Indirect Shadow", but not a direct "Cull Obstructed" option.

    3. Render Settings: In the Project Settings, under the "Engine Settings" > "Rendering" section, you can find various render settings that might help with culling and optimization, such as settings related to occlusion culling.

    4. Custom Shaders and Materials: If you're working with custom shaders or materials, you can implement custom culling logic using HLSL (High-Level Shading Language) or UE5's Material Graph. This would require programming knowledge and understanding of shader development.

    5. Occlusion Culling: UE5 has a built-in occlusion culling system that can automatically cull objects that are not visible to the camera. You can enable and configure occlusion culling in the Project Settings under "Engine Settings" > "Rendering" > "Occlusion Culling".

    If you're experiencing issues with obstructed geometry or depth fighting, I recommend exploring the above options and settings to find the best approach for your specific use case.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.