RenderQueue CameraController issues

So I have been working on a small prototype which includes spherical worlds which has provided to not be the simplest of tasks, but I am now running into an issue when it comes to using the RenderQueue, as well as with my camera controller. I have included a YouTube video showing off each of these problems.

To start with, the faked atmosphere using a simple plane and gradient texture. I have been able to achieve the desired look of the atmosphere without any issue, but I am seeing the plane being clipped by the world geometry (Which can been seen in the first part of the video). To attempt to counter this issue I created a derived MonoBehaviour which its sole purpose is to modify the render queue to render before the other objects. But this has provided either the object not being rendered entirely, or being so transparent it is hardly visible.

Directly below is the code as described above. As described in the documentation, the geometry is rendered at a place in the queue starting at 2000, so naturally I started by trying to have the plane rendered at 1999 and worked my way down from there without reaching the desired result. I am sure this issue all comes from a lack of understanding how exactly the RenderQueue functions, but any insight would be greatly appreciated.

using UnityEngine;

public class CustomRenderQueue : MonoBehaviour
{
    //-------------------------------------------------------------------
    #region Field

    [SerializeField]
    private int m_RenderOrder = 1;

    #endregion


    //-------------------------------------------------------------------
    #region Start method

    private void Start()
    {
        // Set render order of the GameObject
        this.gameObject.renderer.material.renderQueue = this.m_RenderOrder;
    }

    #endregion
}

Now for the CameraController, as can be seen in the last half of the video, the camera flips 180 degrees when the controlled GameObject approaches the backside of the sphere. The controller in its current state is very simplistic, using Lerping for the position and transform.LookAt() to always have the controlled object in focus. I am fairly sure this behaviour is coming from the use of LookAt(), but I am not entirely confident as such. I’m not sure if I will have to delve into quaternions for the camera rotation, or if there is something else that I happen to be overlooking.

I would greatly appreciate any guidance on either of these two issues, thank you for your time in reading this post and look forward to hearing from the community soon!

The camera flipping is probably gimbal lock. Use quaternions for rotation instead.

Thank you for the heads up on the gimbal lock Wolfos, that hadn’t even crossed my mind. After refreshing myself on quaternions, the camera rotation issue has been resolved.

I am still at a loss though on what to do for the clipping, in regards to the atmosphere planes that I am currently using. If there are any suggestions to be lent, I would be quite grateful!

Instead of playing with the render queue, why not just create a shader that will always draw the halo, if that’s what you are after?

@Jaimi
The halo is currently always drawing at this point, I am just attempting to have it drawn before all other geometry save for the skybox so that there will be no sign of it cutting through any object. I have no experience with shaders at this point as before I moved to Unity it was all HLSL/GLSL which may as well have been a foreign language to me. I have tried taking the default Unlit/Transparent shader, which is what I am using now, and playing with the ZWrite and ZTest values but this hasn’t provided any results.

Am I moving in the write direction with modifying these values, or I am just getting myself even more lost at this point?

Any community member happen to be able to point me in the right direction for how to accomplish this shader?