-
-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avm2: Implement Matrix3D with 2D support only #18888
base: master
Are you sure you want to change the base?
avm2: Implement Matrix3D with 2D support only #18888
Conversation
7473740
to
ac547ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This log is taken from Adobe Flash Player 32.
ac547ca
to
69f6554
Compare
#18908 produced Git conflict with this PR and it actually implemented a kind of "2D/3D switch" inside DisplayObject. Rebased and followed its design now. |
a3a3018
to
6417e5f
Compare
Rebased. Thanks to #18911 , this PR gets much more slim. |
796ced1
to
35413ad
Compare
Replace stubs for flash.geom.Transform.matrix3D getter/setter with an actual implementation of Matrix3D with limited support. This implementation is just a proxy to the existing 2D matrix implementation. Therefore transformations beyond 2D transformation works differently from the expected result.
35413ad
to
236c1cb
Compare
Rebased. |
@@ -1,7 +1,8 @@ | |||
num_frames = 1 | |||
|
|||
[image_comparisons.output] | |||
tolerance = 0 | |||
tolerance = 10 | |||
max_outliers = 4000 | |||
|
|||
[player_options] | |||
with_renderer = { optional = true, sample_count = 1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the FP screenshot was done using high quality, in which case the sample count should be 4. This will hopefully make images closer to each other (so that we can possibly drop max outliers)
Also this commit can be safely squashed with the previous test commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I took the screenshot with high quality. I see, I didn't know the meaning of sample_count
. Now fixed and squashed to 770d63e !
However, max_outliers
cannot be dropped so much
Image 'output' succeeded: 3690 outliers found, max difference 255
Here is the diff created by imgtests
:
The edges of the objects may be slightly different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right. I've been trying to debug it but it seems that Flash just renders those objects differently with Matrix3D
compared to Matrix
, even if they represent the same transformation. I think we have to leave high max outliers and just add FIXME/TODO above it which describes the issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't notice that 2D and 3D had the difference. True. Thank you, I added a comment: 81de5b6#diff-1cc83ff3bc64c1ef783edf3b104e090e3ea173a7298b6a3322ccdd7538fe80ecR5
trace("sprite3D.transform.matrix3D.rawData", sprite3D.transform.matrix3D.rawData); | ||
trace("mat3D.rawData", mat3D.rawData); | ||
|
||
//// FIXME: matrix3D.rawData should be updated by x/y update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that's already the case, it's just that we don't reset tx,ty on matrix3D = null
and the assertions below fail.
We could also do some more assertions related to non-indentity 3D matrices, I think we can safely do that without modifying the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f17cb03
to
019476d
Compare
Co-authored-by: Kamil Jarosz <[email protected]>
.matrix = A, .matrix = null, then .matrix3D has the info of the matrix A. .matrix3D = A, .matrix3D = null, then .matrix is reset to the identity.
019476d
to
af60217
Compare
Retry #18810 .
Partially resolves #8033 .
#18810 (comment)
Commits
perspectiveProjection
,matrix3D
stubs #18908 : 2D/3D switch ( https://docs.ruffle.rs/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Transform.html#matrix3D ).