Skip to content

Paint in place for real#230

Closed
Gaurav0 wants to merge 55 commits intomasterfrom
paint-in-place-for-real
Closed

Paint in place for real#230
Gaurav0 wants to merge 55 commits intomasterfrom
paint-in-place-for-real

Conversation

@Gaurav0
Copy link
Member

@Gaurav0 Gaurav0 commented Oct 14, 2025

I am not super familiar (or familiar at all) with this WebGL stuff but basically it goes like this:

  • Select one of the parts we are going to be recoloring dinamically (for now only the pieces that are tied to the body color as they seem to be using the same palette)
  • Create a canvas with a webgl context (shared - expensive operation performed once)
  • Initialize a recolor cache
  • Download the base variant for the asset (light)
  • Apply recolor in the webgl canvas.
  • Copy to an output webgl canvas so we can reuse the shared one for the next drawing.
  • Copy to a 2D context canvas we have offscreen. This is then copied once again to the preview canvas, and is the one used for downloads and stuff.

With CPU pixel by pixel it takes 190ms-230ms. With GPU it takes around 90ms-130ms.
The improvements are there and seem to be working. I may not be using the optimal setup tho.

@Gaurav0 Gaurav0 force-pushed the paint-in-place-for-real branch from f990e53 to a48500e Compare October 14, 2025 04:54
@Gaurav0 Gaurav0 added the enhancement New feature or request label Oct 14, 2025
@Gaurav0
Copy link
Member Author

Gaurav0 commented Oct 14, 2025

I'm not sure why this didn't deploy automatically.

Deployed to https://paint-in-place-for-real--liberatedpixelcup.netlify.app/

@cdvv7788 cdvv7788 force-pushed the paint-in-place-for-real branch from a48500e to 6b89076 Compare October 14, 2025 15:35
@cdvv7788
Copy link
Contributor

@Gaurav0 @jrconway3 I am done for now with this PR. I will need more details for other recolors, but there are a bunch of items being drawn on the fly now.
It may be a good idea to have someone else try to add the next palette (there is a document for that) to see if it is understandable and easy to follow along.
Awaiting approvals to move on to the next big thing I want to try: A component to pick/make palettes on the fly. If I succeed, the variants can be presented in different ways, and we can reduce the tree clutter. We will see :).

@Gaurav0 Gaurav0 force-pushed the paint-in-place-for-real branch from 907bdea to 81dda74 Compare October 24, 2025 09:17
@Gaurav0 Gaurav0 requested review from cdvv7788 and jrconway3 January 13, 2026 11:21
@Gaurav0 Gaurav0 changed the base branch from full_rewrite to master January 13, 2026 11:25
@Gaurav0 Gaurav0 added the refactor changes internal implementation label Jan 13, 2026
@Gaurav0 Gaurav0 mentioned this pull request Jan 20, 2026
@Gaurav0
Copy link
Member Author

Gaurav0 commented Jan 20, 2026

Closing in favor of #284

@Gaurav0 Gaurav0 closed this Jan 20, 2026
@github-project-automation github-project-automation bot moved this from In Progress to Done in Full rewrite Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor changes internal implementation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants