avm2: Implement UVT-mapped bitmap triangles across render backends and move triangles outside tassellation - #24254
Open
wsxarcher wants to merge 4 commits into
Open
Conversation
Member
|
Have you looked into the following? |
Contributor
Author
|
Only the second one and took inspiration as I thought it was abandoned, the focus was making the game work. Did not know about the first PR, but I can wait to rebase if there is an ongoing refactor. |
Member
|
The second one mentions the issue: triangles probably should not go through tessellation. Triangles in Flash Player behave differently compared to drawn shapes (cf. unfinished strokes/fills), and in addition, it doesn't make sense to tessellate triangles in general, as they are primitive shapes and the point of using them is performance in the first place. |
Contributor
Author
|
You are right, now it has a new drawing command just for triangles like your draft and I added the tests from the old PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes AVM2
Graphics.drawTrianglesandGraphicsTrianglePathfirst-class indexed triangle primitives. Vertices, indices, UV/UVT data, and culling are validated before rendering, while bounds, hit testing, active fill state, and Flash’s independent-triangle winding behavior are preserved.Triangles now bypass Lyon tessellation and are uploaded directly across Canvas, WebGL, and WGPU. WebGL and WGPU use dedicated UVT vertex layouts and perspective-correct homogeneous interpolation without increasing ordinary shape vertex sizes; Canvas computes a bitmap transform per triangle. Unit and visual coverage includes UV/UVT conversion, invalid data, winding, drawing state, hit testing, and bitmap mapping.
Fixes #17639
Checklist