Is it possible to create a material with frontface culling?

With Shader Forge in Unity it’s possible to make materials which don’t render the front-facing surfaces of a mesh. This creates a really interesting and surreal “follow me eyes” concavity effect on certain shapes, but I can’t find any way to recreate it in UE4. Is it currently possible?

Can you post a screenshot of what it looks like please?

Nope! Because it creates an optical illusion where it just looks like an equivalent mesh that sticks “out” rather than “in”. Here’s a video of me rotating around some cubes which have the effect though: - YouTube

It’s like that animated gif of the spinning ballerina; You kind of have to squint and think a bit to notice that you’re actually seeing the interior of the cube.

Ahh, i see. One way to do it is to flip the normals of the cube(or whichever mesh) in your modeling software. That way the material will be applied to the inner faces of the mesh.

I didn’t think of that, thank you! That’d be a workaround.

An option if you want to avoid flipping your normals in your meshes:

If you don’t require per-material control and per-mesh actor control would be fine, you can make a custom component derived from UStaticMeshComponent. This will be incur less rendering overhead.

  1. Create a scene proxy derived from FStaticMeshSceneProxy

  2. Override GetShadowMeshElement, GetMeshElement, and GetWireframeMeshElement in your custom scene proxy

  3. In the overrides from step 2, call the parent class’s version to fill out OutMeshElement, and then to switch to front-face culling do:

    OutMeshElement.ReverseCulling = !OutMeshElement.ReverseCulling;

  4. Create a component derived from UStaticMeshComponent

  5. Override CreateSceneProxy in your derived component and return your overridden scene proxy created above.

  6. Use this new component on a new actor class (either in Blueprint or C++)

I don’t know what half those words mean but I will make it my mission to find out. Thank you for such a detailed response! Hopefully this will just be a checkbox in the material editor one day, hah.