Skip to content

Time Of Day Colors for GLBs#4111

Open
Jakjm wants to merge 20 commits intoopen-goal:masterfrom
Jakjm:timeOfDayChanges
Open

Time Of Day Colors for GLBs#4111
Jakjm wants to merge 20 commits intoopen-goal:masterfrom
Jakjm:timeOfDayChanges

Conversation

@Jakjm
Copy link

@Jakjm Jakjm commented Dec 31, 2025

With help from @gratefulforest, I've implemented storing colours for each time of day for meshes,
and updated the code to store 32 channel colours (8 times of day * 4 rgba channels).

2025-12-27.12-33-08.mp4

In addition, I've implemented a system @gratefulforest suggested which makes adding different times of day
really easy for developers.

  • If some times of day are missing, they use the closest time of day that is defined, defaulting to the earlier of the two if there are two equally closest defined times of day.
  • If no times of day are defined, COLOR_0 is used, otherwise white is used.

Log messages are concise and very informative:

[46:23:278] [info] Reading gltf mesh: /home/jakjm/git/jak-project/custom_assets/jak1/levels/test-zone/test-zone2.glb
[46:23:278] [warn] Plane missing some times of day, using sunrise:_EVENING, morning:_EVENING, noon:_TWILIGHT, afternoon:_TWILIGHT, sunset:_TWILIGHT, twilight:_TWILIGHT, evening:_EVENING, green sun:_EVENING
[46:23:278] [error] Cube.001 didn't have any colors, using white.
[46:23:278] [warn] Cube.002 had colors but no times of day, using COLOR_0.
[46:23:278] [warn] Cube.003 missing some times of day, using sunrise:_SUNRISE, morning:_SUNRISE, noon:_SUNRISE, afternoon:_SUNSET, sunset:_SUNSET, twilight:_SUNSET, evening:_SUNSET, green sun:_SUNRISE
[46:23:278] [warn] Cube.004 had colors but no times of day, using COLOR_0.
[46:23:278] [error] Cube.005 didn't have any colors, using white.

@OpenGOALBot
Copy link
Collaborator

Can one of the admins verify this patch?

@Jakjm
Copy link
Author

Jakjm commented Dec 31, 2025

This is my first time contributing so please let me know if I've missed anything! I've tried to update the kd-tree color quantization code but there might be things I didn't implement right. @gratefulforest was able to verify that everything is working as expected so far...

Anyway yeah, please let me know what I can improve and how to fix up these changes to get them merged :)

@Jakjm
Copy link
Author

Jakjm commented Jan 1, 2026

To use this, create a Color Attribute or rename an existing one with a _ followed by the time of day:
_SUNRISE
_MORNING
_NOON
_AFTERNOON
_SUNSET
_TWILIGHT
_EVENING
_GREENSUN

Then, you need to ensure Data -> Mesh -> Attributes is checked on the GLB export window.

Has been tested by @gratefulforest in a variety of circumstances and also doesn't affect transparency.

@Jakjm Jakjm marked this pull request as ready for review January 1, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants