Skip to content

feat(renderer): implement per-polygon fills for 2D shape #7722 #7729

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LalitNarayanYadav
Copy link

Description

This PR implements per-polygon coloring support for 2D shape primitives to match WebGL behavior where possible.

Changes

  • Added per-polygon color support for:
    • TRIANGLES
    • TRIANGLE_STRIP
    • QUADS
    • QUAD_STRIP
  • Fixed vertex winding order in strip primitives
  • Replaced indirect color setting via pInst with direct renderer methods
  • Maintained all existing functionality
  • Optimized path handling

Testing

Verified rendering behavior matches WebGL output for:

  • Gradient meshes
  • Multi-colored shapes
  • All primitive types
  • Existing unit tests pass

Notes

While we can't achieve perfect WebGL parity (no vertex color interpolation), this provides the closest possible 2D approximation.

Copy link

welcome bot commented Apr 13, 2025

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

@LalitNarayanYadav
Copy link
Author

fixes #7722

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant