gpu: replace toScreen function with a projection matrix

The face sorting still requires the toScreen function to match exactly
the same order that would be computed on CPU, but for the projection for
rendering we can simplify it by replacing it with a projection matrix.

This also drops the requirement of having a geometry shader to remove
faces too close to or behind the camera. Upon closer inspection it looks
like the client can draw faces which have at least one vertex which is
>= 50 from the camera, so this now more accurately reflects the software
renderer.

Co-authored-by: Adam <Adam@sigterm.info>
This commit is contained in:
Runemoro
2020-09-22 08:02:27 -04:00
committed by Adam
parent 1777b2d6bd
commit 8c00f6da88
4 changed files with 32 additions and 138 deletions

View File

@@ -49,7 +49,7 @@ import net.runelite.api.widgets.WidgetInfo;
*/
public class Perspective
{
private static final double UNIT = Math.PI / 1024d; // How much of the circle each unit of SINE/COSINE is
public static final double UNIT = Math.PI / 1024d; // How much of the circle each unit of SINE/COSINE is
public static final int LOCAL_COORD_BITS = 7;
public static final int LOCAL_TILE_SIZE = 1 << LOCAL_COORD_BITS; // 128 - size of a tile in local coordinates