Is there any distance limitation for LineRenderer?

Hi,

I am trying to draw orbits of objects dynamicaly, storing the last positions and using them to create a linerect on each frame.

I works fine when it is close to the object but when the disntace is high (about 1+10e) linerect is not drawn.

I have checks the values and all of the seem to be fine. I have also tryed to draw the line near the cam using functions such as ScreenPointToWorldPoint and inverse function changing the z value but I lose a lot of resolution of the position.

I am also sure it is not a problem of near and far clipplanes, I have been working with far distances for a long time and know how it works… (in fact I use 64bits vector positions) ¿Anyone has any idea? My next idea is not to use LineRender and draw the line as a mesh directly.

Unless you’ve set the far clip plane to an unusably high distance, it would be. If you use a very large far clip plane then you lose z buffer resolution; normally you don’t want to go beyond 2000 or so. You might be interested in this, though it’s still subject to camera clip planes if you draw into the scene (if you draw as an overlay, then it uses a separate camera).

–Eric

I didn’t realize that depth resolution depends of near and far clipplanes… I was testing it yesterday and I worked fine changing far and near clip planes!! I will use another camera just for that purpose…

Thanks a lot Eric5h5!!