Make an object render at least 1 pixel big regardless of distance

Hi. This is my first question, so please excuse me if I’m doing anything wrong. :slight_smile:

I'm trying to make a fantasy space combat game as close to the original TIE Fighter as possible.

While this is a minor detail, it’s something I would really like to have for getting the right “atmosphere”.

I have created the blaster shots that ships shoot in this game with a Line Renderer. This is how it looks in the scene editor when really close.

Close view of blaster shots

They are about 5 meters long, and it uses a custom shader that makes it self glow full bright, to obtain the effect of an energy projectile. The shader is taken from here .

It works nice and cool, but I need the blaster shots to be visible at any distance, regardless of how far they are. I don't mean the far clipping distance. I mean that while at a medium distance they look okay...

...as they are farther and farther away, their "thickness" on-screen becomes smaller than one pixel. To the point that they become invisible.

In normal circumstances, that would be totally what we would expect to happen, of course. But the visual effect I aim to obtain is this one taken from the original game:

In that screenshot, you can see a blaster shot just coming from the player ship at full thickness because it's really close. However, those ships in the distance are about 3 kilometers away but their shots are totally visible because they are never drawn at less than 1 pixel thick.

That effect is desirable, because space battles take place at big scales and distances and you need to see the ships interchanging blaster fire regardless of how far you are from them, otherwise they look like they are not attacking each other at all if you are not immediately next to them.

Making the blaster shots thicker doesn't work because even if they would look nice from afar, they would look ridiculously thick if you are close by.

I don't know if there would be a super-simple way to do this just adding a line or two to the custom shader. I cannot estimate the complexity of making a shader that always render an object at one pixel thick minimum regardless of how far it is.

If this cannot be done easily in a shader, I guess I could script all blaster shots to become thicker when they are farther away than certain distance from the camera, but it sounds more like a hack.

Any hint? Thank you in advance! :)

You need to use GL lines you can read about them in the documentation all you need to do is have your laser made of two game objects as vertices and then the line will follow those two points.(keep in mind gl lines are projected to the screen so the script must be attached to the main camera).