I need to be able to render “hole” meshes on top of a board (pinball game) without having to cut an actual hole in the board geometry (the playfield is editable by the user). These holes are cosmetic and don’t affect the physics, but they’re large enough that just a 2d decal wouldn’t look right.
Below is a screenshot from an older pinball game that accomplishes what I’m after. You can see from the wireframe that the board surface is just quads. It does not have the hole cut out, the “hole” is a mesh rendered on top of the board, only drawing where the “hole” should be.
I imagine in their app it went something like:
- draw the board
- draw a 2D shape where the hole should be, clearing the depth buffer just for those pixels
- draw everything else normally
Perhaps something could be done using the custom depth buffer to accomplish this? Or some sort of stencil masking?
Is there a way to control draw order of certain objects in UE4 and/or draw to the depthbuffer?