Skip to content

Conversation

@LalitNarayanYadav
Copy link
Contributor

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.

@welcome
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
Contributor Author

fixes #7722

@ksen0
Copy link
Member

ksen0 commented Jun 3, 2025

Hi @LalitNarayanYadav ! I'll close this PR based on the discussion in the associated issue - since a different PR on dev-2.0 branch would be needed. Thanks for working on it!

@ksen0 ksen0 closed this Jun 3, 2025
@LalitNarayanYadav
Copy link
Contributor Author

Thank you for the feedback and clarification!
I’ll work on the dev-2.0 branch as suggested and reopen a new PR accordingly.
Appreciate the guidance!

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.

2 participants