Either a cool effect or good performance. How do I eat cake and have cake?

I’m doing pixelated 3D using this tutorial: Creating perfectly pixelated games with Unity (2D or 3D)

Unfortunately in part of my game clicking on objects is required (which is implemented using OnMouseUpAsButton()).

So if I render on game camera everything to render texture and on “actual” camera (that is child of game camera and has as a child quad rendertexture is displayed on so cameras are aligned perfectly) I only render quad texture is displayed on, using Culling Mask, everything is shown just fine (as game camera’s culling mask is set to everything but the layer display quad is on).

But then I can’t click things. Alignment is not an issue (as cameras are always aligned perfectly), neither is display quad blocking casts (as it is on IgnoreRaycast layer).

There’s solution to this: Enable rendering everything on both cameras. Now I can click everything, but because game has effectively to render level two times, one of which is unnecessary (as it is quickly covered by display quad), performance suffers greatly as a result.

How can I do it so I can get good performance AND be able to click things?

Hi, I am the writer of the article. Hmm, I hadn’t thought of it before.

I don’t know an easy solution, unfortunately, but if I were you I would write my own code instead of OnMouseUpAsButton() event. I’d check whether the mouse is up and then raycast on the player camera by myself.