]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
initial support for user clipping plane in dpsoftrast
[xonotic/darkplaces.git] / gl_backend.c
index 7bc929e9b60d5864a8ffbd84759cb4f8c69db2d2..bb1d6b16abbaab385f2a4b104e7032b34ec5eb4c 100644 (file)
@@ -730,7 +730,7 @@ static void R_Viewport_ApplyNearClipPlaneFloatGL(const r_viewport_t *v, float *m
 
        VectorSet(normal, normalx, normaly, normalz);
        Matrix4x4_Transform3x3(&v->viewmatrix, normal, clipPlane);
-       VectorScale(normal, dist, v3);
+       VectorScale(normal, -dist, v3);
        Matrix4x4_Transform(&v->viewmatrix, v3, v4);
        // FIXME: LordHavoc: I think this can be done more efficiently somehow but I can't remember the technique
        clipPlane[3] = -DotProduct(v4, clipPlane);