Can't make Paper2d sprite material with backface culling enabled

I’m trying to make a playing card in Paper 2d, and I had planned on doing it with the following method:

  • Create 2 sprites at the same position, one for the card front and one for the card back
  • Rotate the card back sprite 180 degrees so it is facing the opposite direction
  • Create a modified material that disables ‘two sided’ in the material settings

However, no matter what I do on the material, the sprite in the world is being rendered without backface culling.

It’s worth noting that in the material editor my material preview appears to be correctly one-sided if I rotate the preview around. However in both the sprite editor and the world view the sprite is rendered without culling.

UPDATE:

After some more digging I found out the following:

The Paper2d render proxy uses a cvar to control whether or not sprites render two sided. It’s a global setting that affects all sprites regardless of their material settings. The cvar is:

r.Paper2D.DrawTwoSided

And the values:

  • 0: Render sprites as one sided
  • not 0: Render sprites as two sided

You can test this in the console by typing:

r.Paper2D.DrawTwoSided 0

I tried adding this to my DefaultEngine.ini like so:

[/Script/Paper2D.PaperRuntimeSettings]
r.Paper2D.DrawTwoSided=0

But the editor isn’t picking it up like I’d expect it to. Is there something else I need to do for this to happen?

Hey rje,

The definition of a Sprite in unreal is a Texture Mapped Planar Mesh and associated Material that can be rendered in the world. This planar mesh will always render two-sided so that flipping the sprite will allow for your flipbooks to render correctly when rotating something like a character.

You can use this to your advantage by adding some custom instructions to your material by assigning a different texture to either side of your sprite. Try following along with the post I have provided to see if you can get your desired results. If not, let me know and I provide some other suggestions.

Thank you,

For anyone else looking to do the same thing, the answer can be found here: Can you assign 2 different materials to each side of a mesh surface? - Rendering - Epic Developer Community Forums