Are sprites which player never see a good idea?

Location in my game looks like flat cube as floor and long+high cube as wall and I need to add materials to them to have specific sprites on them. The issue is shown on next 2 screenshots - while player will see location as I want, sprite images are shown on all sides of cube, even which are never visible by player.


So my question is what is ‘bestpractice’ in such cases? Is there any way to make unity draw sprite on one cube side only and will it significantly improve the perfomance? Or its ok to have sprites on all 6 sides of cube even if only one is visible?

The back side of geometry is generally not rendered due to backface culling

Let me assist you in nailing down your terminology: nothing above looks like a Sprite… it just looks like Textures on Materials being Rendered on a Mesh…

Terminology primer for assets:

Finally, if you intend to sprinkle actual sprites all over this surface, which is a great idea, keep this in mind:

Three (3) primary ways that Unity draws / stacks / sorts / layers / overlays stuff:

In short, as far as the Standard Rendering Pipeline,

  1. The default 3D Renderers draw stuff according to Z depth - distance from camera.

  2. SpriteRenderers draw according to their Sorting Layer and Sorting Depth properties

  3. UI Canvas Renderers draw in linear transform sequence, like a stack of papers

If you find that you need to mix and match items using these different ways of rendering, and have them appear in ways they are not initially designed for, you need to:

  • identify what you are using
  • search online for the combination of things you are doing and how to to achieve what you want.

There may be more than one solution to try.

For instance, you may even use multiple co-located cameras (along with different Layers and LayerMasks drawn to different-depth Cameras) to more-explicitly control apparent draw ordering.

Additional reading in the official docs:

And SortingGroups can also be extremely helpful in certain circumstances:

Other rendering pipelines may have other ways of layering (HDRP and URP). Go see the latest docs for details.

There’s lots of third party open source packages available as well, such as this:

1 Like

the best practice is to dont use a cube, use a plane/quad, and then you can make it so that it only displays the texture on one side, like a paper page but one side is invisible

its indeed worse for performance to have cubes, you might say that its 5x worse, because you have 5 faces of each cube that are useless but are being rendered, not only the bottom but the sides aswell

1 Like

In theory, yes, but in practice there really isn’t any difference because the faces are all part of the same draw call and it doesn’t matter if there is one, or six, or six hundred faces in a draw call. For the GPU it’s all the same. By the way, the default “Plane” object has more faces (triangles) than the cube, 200 to be precise. But as I said, that really doesn’t matter. Especially with backface culling.