-
Notifications
You must be signed in to change notification settings - Fork 31
Fix wrong color range #1088
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
base: develop
Are you sure you want to change the base?
Fix wrong color range #1088
Changes from all commits
676f96a
8b42d80
caf3f99
4c87e83
a97fa0b
a99bd07
b30de7f
4ca0ae8
3ead38c
01b192c
020f804
19e6e48
4444fe7
cb628c6
cd5c558
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -123,7 +123,8 @@ private Vector3 CalculateLightForCustomVertex(Room room, Vector3 position, Vecto | |||||||
| output += RoomGeometry.CalculateLightForVertex(room, light, position, normal, false, false); | ||||||||
| } | ||||||||
|
|
||||||||
| return Vector3.Max(output, new Vector3()) * (1.0f / 128.0f); | ||||||||
| // Normalize to 0...1 range | ||||||||
| return Vector3.Max(output, new Vector3()) * (1.0f / 255.0f); | ||||||||
|
||||||||
| return Vector3.Max(output, new Vector3()) * (1.0f / 255.0f); | |
| output = Vector3.Max(output, Vector3.Zero); | |
| return Vector3.Clamp(output * (1.0f / 256.0f), Vector3.Zero, Vector3.One); |
Copilot
AI
Mar 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s a tab-indented line here (HitPoints = 0,) which is visually misaligned with surrounding entries (spaces) and will keep showing up as noisy diffs depending on editor settings. Re-indent this line consistently with the rest of the object initializer.
| HitPoints = 0, | |
| HitPoints = 0, |
Copilot
AI
Mar 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normalization is applied in multiple places via hard-coded * 0.5f factors (vertex colors, ambient light, instance colors, light colors). To reduce the risk of future inconsistencies (like the current /255 vs *0.5f mismatch), consider centralizing this into a small helper/constant (e.g., NormalizeTeColor(...)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For readability and to avoid repeating the normalization factor per-component, consider constructing this as
new Vector4(instance.Color * 0.5f, 1.0f)(or a shared normalization helper) instead of multiplying X/Y/Z separately.