Skip to content
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

Feat/customizable colors #183

Merged
merged 5 commits into from
Dec 25, 2024
Merged

Feat/customizable colors #183

merged 5 commits into from
Dec 25, 2024

Conversation

piellardj
Copy link
Member

This PR adds support for customizable colors on models that support it, by adding a new API

ThreeEntity.custom_colors: null | {
      color1: THREE.Color
      color2: THREE.Color
      color3: THREE.Color
    }

For a model to support it, it should have textures:

  • diffuse_base
  • diffuse_color1
  • diffuse_color2
  • diffuse_color3

Then on this model, the diffuse_base is replaced by a texture computed as follows:
on a transparent canvas, I first draw the original unmodified diffuse_base. Then on top of it, I draw diffuse_color1 colored by color1, then diffuse_color2 colored by color2 etc.

More generally, this PR prepares code to support any customizable texture based on the naming scheme XXX_base, XXX_color1, XXX_color2 etc.

@piellardj piellardj self-assigned this Dec 17, 2024
Copy link

vercel bot commented Dec 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
aresrpg-dapp ✅ Ready (Inspect) Visit Preview Dec 25, 2024 5:47pm

@piellardj piellardj requested a review from Sceat December 23, 2024 13:22
@piellardj piellardj marked this pull request as ready for review December 23, 2024 13:22
piellardj and others added 5 commits December 26, 2024 02:02
So that they can have customizable and unique color combinations
For instance, if on a model I find textures:
- diffuse_base
- diffuse_color1
- diffuse_color2
- diffuse_color3

then I will create a CustomizableTexture called "diffuse" based on them
@Sceat Sceat force-pushed the feat/customizable_colors branch from f610125 to df0d286 Compare December 25, 2024 17:46
@Sceat
Copy link
Member

Sceat commented Dec 25, 2024

/merge

Copy link

Success! Fast forwarded master to feat/customizable_colors! git checkout master && git merge feat/customizable_colors --ff-only

@github-actions github-actions bot merged commit df0d286 into master Dec 25, 2024
1 check passed
@github-actions github-actions bot deleted the feat/customizable_colors branch December 25, 2024 17:48
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