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

Add lightColor to Cesium3dTilesTraits #7452

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

Conversation

ykiu
Copy link
Contributor

@ykiu ykiu commented Feb 2, 2025

What this PR does

Expose the lightColor setting for 3D Tilesets in Cesium3dTilesCatalogItem.

Test me

Start a local dev server on localhost:3001 and compare two lightColor settings.

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • I've updated relevant documentation in doc/.
  • I've updated CHANGES.md with what I changed.
  • I've provided instructions in the PR description on how to test this PR.

Copy link
Collaborator

@na9da na9da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ykiu,

Thanks for contributing the change.
I have left a suggestion.

Cheers

description:
"The light color when shading models. When undefined the scene's light color is used instead. eg: [255, 255, 255]."
})
lightColor?: number[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Most other color traits in Terria are typed as a string and then converted to Cesium.Color using Cesium.Color.fromCSSString() (example). I think we should follow the same pattern here. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestion,@na9da. That's what I initially went with, but lightColor doesn't seem to be a standard 24-bit RGB color. When I compare [4095, 4095, 4095] and [255, 255, 255], the former appears brighter. So, I assume limiting it to the [0-255] range is not relevant here.

image

Left: [255, 255, 255]; right: [4095, 4095, 4095]

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