Commit Graph

80 Commits

Author SHA1 Message Date
Zak Middleton
9674d980a9 #ue4 - Perf: VInterpNormalRotationTo() now uses faster FQuat::RotateVector() rather than converting to matrix first.
[CL 2630180 by Zak Middleton in Main branch]
2015-07-23 01:49:22 -04:00
Zak Middleton
a34750d711 #ue4 - Improve FQuat::FindBetween() and add some Vector->Orientation functions that include Quat results.
- Faster FQuat::FindBetween() implementation. Add FindBetweenNormals() and FindBetweenVectors() to indicate different input length requirements.
- Add FVector::ToOrientationQuat(). This preserves the up vector (result has no roll).
- Add FVector::ToOrientationRotator(), matching FVector::Rotation() implementation.
- Add unit tests.

UE-14015

[CL 2629689 by Zak Middleton in Main branch]
2015-07-22 17:43:43 -04:00
Zak Middleton
64f519ba27 #ue4 - Move some math and collision stats to a verbose stats group.
- Quat<->Rotator conversions now in MathVerbose.
- Collsion Pre/Post filter now in CollisionVerbose.

[CL 2617482 by Zak Middleton in Main branch]
2015-07-10 19:44:33 -04:00
Jack Porter
b51f8cf7bf Correct fix for FSphere::TransformBy(FTransform) which wasn't multiplying W by the scale.
[CL 2610700 by Jack Porter in Main branch]
2015-07-05 22:38:09 -04:00
Jack Porter
8245e04d7c Fix for FSphere::TransformBy(FTransform) which wasn't multiplying W by the scale.
[CL 2610679 by Jack Porter in Main branch]
2015-07-05 21:53:05 -04:00
Richard TalbotWatkin
18e9af710b Deprecated FRotator::operator-() and created a new method GetInverse(). Componentwise negation is a meaningless operation on a Rotator.
#codereview Steve.Robb, Zak.Middleton

[CL 2608356 by Richard TalbotWatkin in Main branch]
2015-07-01 17:36:56 -04:00
Zak Middleton
5a931b7fd8 #ue4 - Add FTransform::RotationEquals, TranslationEquals, and Scale3DEquals to check relevant component of another FTransform for equality.
- Renamed the old private versions to make them clearly private.
- We do it this way because there is a cost to conversion such as A.GetRotation().Equals(B.GetRotation()) in the vectorized FTransform, where it's more efficient to keep the components in the VectorRegister through the comparison.

#codereview James.Golding

[CL 2606294 by Zak Middleton in Main branch]
2015-06-30 15:27:54 -04:00
Jamie Dale
ae55491cdf More text filter improvements
The "-" token as been removed from the list of general NOT operator aliases, and is now only available as TextCmpInvert. This means that negative numbers will now parse correctly, but also means that we can now handle complex expressions like "name=-Thing" as a user might expect (equivalent to "name!=thing").

The expression is now evaluated once after compilation (using a dummy context) so that syntax error information can be reported back to the user. Previously evaluation error information was being lost.

#codereview Andrew.Rodham

[CL 2602053 by Jamie Dale in Main branch]
2015-06-26 08:36:04 -04:00
Nick Darnell
068e3f3750 Engine - Removing the implemention for the private FLinearColor to FColor constructor to ensure it isn't called by mistake. Fixing a place that was calling it internally to FColor.
#codereview Gareth.Martin

[CL 2593660 by Nick Darnell in Main branch]
2015-06-19 12:02:08 -04:00
Nick Darnell
d287c6143f More Gamma Correction - Didn't catch this on the previous pass, apparently there was an implicit constructor allowing FLinearColor to FColor that was doing pow(2.2) gamma conversion inversion. Rather than leave the implicit constructor, I'm making it private and making people use ToFColor(true). Which is slightly more expensive, but performs the proper sRGB conversion. While fixing this, I found several terrible uses of the implicit constructor, when Hashing FLinearColors we were converting them to FColors first, when clearing FCanvas we were manually gamma correcting but leaving it as an FLinearColor, then implicitly converting to FColor, double gamma corrrecting. Neither of which should even be required as the RHI Clear command expects an FLinearColor. Additionally fixing a myriad of Slate widgets that were all doing FColor conversions needlessly only to convert back to FLinearColor when queuing slate draw commands.
#codereview nick.penwarden, martin.mittring, andrew.brown, gareth.martin

[CL 2593605 by Nick Darnell in Main branch]
2015-06-19 11:17:11 -04:00
Justin Hair
51833051be Fixed an issue where the invalid expressoins evaluation test was printing out a message that had the word "error" in it causing the automation test to fail on the build machines.
Also refactored the expression evaluation test.
- Broke it up to four test implementations based on what is being tests.  This helps QA figure out what is wrong sooner.
- Changed some of the error messages.
- Made the test use the automations "TestTrue" function instead of using a bool to hold the test results to the very end.
- Changed the pretty name so that the tests are grouped together in the UFE automation tab UI.

[CL 2581641 by Justin Hair in Main branch]
2015-06-09 15:10:21 -04:00
Andrew Rodham
770473270f Expression parser improvements
Refactored the guts of FExpressionNode to better afford holding moveable types on the stack. Large types are now also stored in the inline bytes for simplicity's sake, but allocated on the heap, and managed with a TUniquePtr.
Added the concept of an evaluation context that can be passed in to the Evaluate function. Jump tables are now templated on a given context type, which is wrapped up with a supplied context for evaluation purposes into a TOperatorEvaluationEnvironment (so that the evaluation logic need not be concerned with the context itself)

[CL 2576821 by Andrew Rodham in Main branch]
2015-06-04 06:51:01 -04:00
Zak Middleton
1f4e822a56 #ue4 - Remove USE_MATRIX_ROTATOR from FQuat. It's not maintained and makes the code less readable.
[CL 2574863 by Zak Middleton in Main branch]
2015-06-02 19:50:19 -04:00
Andrew Rodham
fa71cee50f Fixed expression parser jump table execution erroneously returning the proxy, rather than a valid result.
This caused the proxy to potentially outlive its content, which caused the automation tests to fail.

Also cleaned up some MoveTemp usage and removed some redundant move operators.
Re-enabled the math expression evaluator tests as smoke tests

[CL 2573794 by Andrew Rodham in Main branch]
2015-06-02 09:27:18 -04:00
Andrew Rodham
6d217386a6 Disabling automation test while I investigate a failure
[CL 2572341 by Andrew Rodham in Main branch]
2015-06-01 08:27:52 -04:00
Andrew Rodham
9f2934acd6 Added support for unit-based numeric math expressions in unit based numeric input boxes
This addresses UE-13765 and UE-13443

[CL 2572301 by Andrew Rodham in Main branch]
2015-06-01 05:56:14 -04:00
Andrew Rodham
3f059f90de Added support for basic string-expression lexing, compiling, and evaluation.
(Complete with VS2012 support)
See ExpressionParserExamples.cpp and BasicMathExpressionEvaluator.cpp for example usage.

[CL 2572297 by Andrew Rodham in Main branch]
2015-06-01 05:54:35 -04:00
Zak Middleton
8f861897d2 #ue4 - Perf: Add vectorized VectorSinCos for SSE platforms. Optimize FRotator->FQuat conversion to use the vectorized version, and also vectorize the quaternion construction operations.
[CL 2571076 by Zak Middleton in Main branch]
2015-05-29 16:08:24 -04:00
Nick Darnell
a7a6176be2 Gamma Correction - Changing the way all FColors are converted into FLinearColor by default. Previously all sRGB textures coming into the engine along with all other usage of FColor -> FLinearColor used a lookup table that assumed the final gamma correction would simply be pow(color, 1/DisplayGamma). However, that's not the case, we use the IEC 61966-2-1 standard on most platforms for both the scene renderer, as well as for gamma correction in Slate. In Slate you should now see an image matching Photoshop instead of being slightly darker in the lower ranges. However, because we don't want to invalidate all existing textures that users have authored, all existing UTextures have a UseLegacyGamma flag set to true, all new textures will be set to false. The flag is part of the DDC key calculation, but steps were taken so that when legacy is true, keys match existing keys to prevent universally invalidating all games DDCs just to make this change.
To summarize,

Old Pipeline: sRGB-Pow(2.2) -> Linear -> sRGB-IEC 61966
New Pipeline: sRGB-IEC 61966 -> Linear -> sRGB-IEC 61966

#codereview gil.gribb, nick.penwarden, martin.mittring

[CL 2571070 by Nick Darnell in Main branch]
2015-05-29 16:03:43 -04:00
Andrew Rodham
979f38dec3 Backing out 2570293, 2570323 and 2570324 while we get it compiling on Xbox
[CL 2570358 by Andrew Rodham in Main branch]
2015-05-29 08:48:50 -04:00
Andrew Rodham
0d372116c3 Added support for unit-based numeric math expressions in unit based numeric input boxes
This addresses UE-13765 and UE-13443

[CL 2570323 by Andrew Rodham in Main branch]
2015-05-29 07:31:12 -04:00
Andrew Rodham
3d9d8e7950 Added support for basic string-expression lexing, compiling, and evaluation.
See ExpressionParserExamples.cpp and BasicMathExpressionEvaluator.cpp for example usage.

[CL 2570293 by Andrew Rodham in Main branch]
2015-05-29 06:37:59 -04:00
Nick Darnell
a9fdf8a2ed Slate - Rolling back CL 2545687. Needs more testing.
[CL 2545706 by Nick Darnell in Main branch]
2015-05-11 14:03:53 -04:00
Nick Darnell
a8ba32d085 Slate - Now using a more accurate Gamma -> Linear space conversion function for converting FColor to FLinearColor. I've generated a new lookup table using the more accurate conversion, Color > 0.04045 ? pow( Color * (1.0 / 1.055) + 0.0521327, 2.4 ) : Color * (1.0 / 12.92); Instead of the pow(Color, 2.2);
[CL 2545687 by Nick Darnell in Main branch]
2015-05-11 13:55:42 -04:00
Zak Middleton
38fea98e89 #ue4 - Perf: Faster Quat->Rotator conversion.
- We only need to normalize 1 axis and only rarely (when pitch is -90 or 90). ASin and ATan2 produce normalized results (as in [-pi, pi]).

[CL 2543229 by Zak Middleton in Main branch]
2015-05-08 13:48:21 -04:00