Particle Effect looks different in Orthographic


As the particle moves to the edges of the screen with an orthographic camera, it looks like it is either being scaled horizontally or rotated on the Y axis. (see image below)

So I’ve narrowed it down to the billboarding of the fragment shader for each particle. Changing it to the following make the particles render correctly for ortho view. Just need to think of the actual fix now :confused:

vec3 billboard(vec3 InstanceCoords, vec2 quadXY, out mat3 localMat) {
    vec3 viewUp = matrix_viewInverse[1].xyz;
    vec3 viewFor = matrix_viewInverse[2].xyz;
    vec3 viewRight = matrix_viewInverse[0].xyz;
    vec3 posCam = matrix_viewInverse[3].xyz;

    mat3 billMat;
    billMat[2] = -viewFor;
    billMat[0] = -viewRight;
    billMat[1] = -viewUp;
    vec3 pos = billMat * vec3(quadXY, 0);

    localMat = billMat;

    return pos;

Created a github ticket here with a proposed fix and discussion: