Trouble pixelating a dynamic line.
Hey, apologies for the long post. I realize what I'm looking for here is very specific, but I hope someone can help me. I'm making a pixel art game in Unity, where the main mechanic is a grappling hook. Since the grapple line will be dynamic in terms of length, direction and curvature, manually animating it is unfortunately not a good option. I use Unity's Line Renderer and this is what it normally looks like:
However, I want it to look like this:
From what I have been able to Google, I came across Bresenham's Line Algorithm (link), which is more or less exactly what I'm looking for, but I'm struggling to find an effective way of implementing it into my project. My attempts have technically produced what I wanted, but I did it by instantiating sprites for every single pixel, that destroyed themselves every single frame, which obviously made performance plummit.
I also have looked a bit into how to potentially do this with shaders, but I know too little about them at this point to know how to proceed.
The Upscale Render Texture setting within Pixel Perfect Camera also more or less does the job in terms of pixelating the line, but unfortunately, this causes the line thickness to change based on the player's position. In addition, enabling this setting overly complicates other parts of my project, so I'd rather not use it if I can.
To clarify one important thing: I want the pixels of said line to be drawn relative to the player, not based on the screen and/or world position, which is what all other pixelation methods I have seen does. Again, sorry for the long post, but I hope I got my problem across and that someone can either help, or point me in the right direction. If I'm going about the problem all wrong as well, I'd like to hear it.
Thanks! :)