jdelauney / SIMD-VectorMath-UnitTest

For testing asm SIMD (SSE/SSE 2/SSE 3/SSE 4.x / AVX /AVX 2) vector math library (2f, 4f, matrix, quaternion...) with Lazarus and FreePascal Compiler
Mozilla Public License 2.0
8 stars 0 forks source link

Perp and Reflect in Vector4f #21

Closed dicepd closed 6 years ago

dicepd commented 6 years ago

Can't seem to get any decent results with these and Vectors, are they supposed to be used with a unit plane? If so then I will move them.

jdelauney commented 6 years ago

No problem move them to TGLZHmgPlane it will be more suitable by the way

dicepd commented 6 years ago

TODO for me revisit HmgPlane and do functional tests.

Have reversed the meaning so Plane is self and Perp has param named P {for point} and Reflect has param V {for Vector} . ASM changes easy just switch the load vars. Will verify when I get 4f finished and checked in.

This order is good for mirrors. Previous order is probably used for vec reflect tri , where we will probably make it a method on Tri or Tri helper.

If needed we can make a helper function in VectorHelper to pass through or build plane;

dicepd commented 6 years ago

@Ok Perp has been fully reworked to reflect GLScene usage. Really badly named function this, it is more of a transform to a coordinate system of a given plane, parallel projection of coords to plane. Anyway I made it hmg safe, if P is passed a point then a point it will remain. This has actually simplified the code and made all but SSE2 more efficient, this is inline with what I have found before, making things hmg compliant often brings speedup benefits.

Unix64 works for SSE SSE3 and SSE4, not tested AVX but we seem to be leaving that behind a bit while we get the main code base working in SSE3, which is fine by me. By the time we come to sort out AVX we will have a full test suite to code against.

jdelauney commented 6 years ago

Yes we can AVX later SSE is enought complicated. We can take a look at the avx after having 100% SSE3 working code and tested. IsColinear is the same as Perp no? we can also moveit

dicepd commented 6 years ago

IsColinear is the same as Perp no? we can also moveit

I would suggest we REmove it. It does not make any sense, I have not tested if it has coplanar functionality, but if so then it should be renamed IsCoplanar. I was originally thinking it could be used in a transformed world where the eye is the origin self is a point on the viewplane and testpoint is a transformed model point. Here it would make sense, but I find no usage like that.

There is no usage of this function in GLScene at all, it is just declared in VectorGeometry and that is it.

dicepd commented 6 years ago

for smooth step you may want to revisit this section result :=t*t * ((t*2.0)*3.0); // = t^2 * 6t = 6t^3

jdelauney commented 6 years ago

There is no usage of this function in GLScene

GLScene is not my priority i've taked it as reference. So no problem for removing non-sens functions :)

I'll take look to smooth step, i've just transposed from NVidia dev docs