- removed the Vector class in the GL renderer and replaced all its uses with FVector3.

- optimized the math to get a plane equation from a linedef. The original code used a generic algorithm that knew nothing about the fact that Doom walls are always perfectly vertical. With this knowledge the plane calculation can be reduced to a lot less code because retrieving the normal is trivial in this special case.
- use the SSE2 rsqrtss instruction to calculate a wall's length, because this is by far the most frequent use of square roots in the GL renderer. So far this is only active on x64, it may be activated on 32 bit later as well, but only after it has been decided if 32 bit builds should be x87 or SSE2.

# Conflicts:
#	src/gl/dynlights/gl_dynlight.cpp

# Conflicts:
#	src/g_shared/a_dynlightdata.cpp
This commit is contained in:
Christoph Oelckers 2017-03-12 19:44:00 +01:00
parent ef3421eee5
commit 4cd0d3d454
8 changed files with 136 additions and 428 deletions

View file

@ -97,12 +97,12 @@ bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, FD
if (light->IsSubtractive())
{
Vector v;
DVector3 v(r, g, b);
float length = (float)v.Length();
v.Set(r, g, b);
r = v.Length() - r;
g = v.Length() - g;
b = v.Length() - b;
r = length - r;
g = length - g;
b = length - b;
i = 1;
}