Time Of Day Colors for GLBs - #4111
Conversation
|
Can one of the admins verify this patch? |
|
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 :) |
|
To use this, create a Color Attribute or rename an existing one with a _ followed by the time of day: 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. |
|
Have you tested this with jak 2 or 3 custom levels? From a quick glance, it looks like the code you're modifying is shared between all 3 games |
Not yet but I will try it for both later on 😊 |
…of the 8 times of day, for a total of 32 channels (bytes) in each color.
…st time of day if possible.
|
Here are some videos demonstrating the use of the same test-zone2.glb file (that GratefulForest was using to test Jak 1) for the later games. Here is a video of me switching to each of the colours one-by-one in Jak 1 for reference: 2026-07-20.13-56-56.mp4In Jak 1, test-zone uses the village1 mood function which blends mesh colours from different times of day, which can make the appearance of the mesh appear different from what you would expect at a given time of day. @dallmeyer showed me on discord that in Jak 2 and 3, test-zone does not use a mood function that blends time of day colours. However, Jak 2 and 3 handle times of day differently from Jak 1 in that they will artificially alter colours according to the time of day, with different multipliers for r,g,b according to the time of day (making them darker in the night and brighter in the day - see this video for more details: https://discord.com/channels/756287461377703987/1094301632776376400/1504260430657487109). I suspect that this new time-of-day lighting system is what makes so many of the colours appear to be a different shade of blue in both Jak 2 and 3 - the colours of the plane are the same across both games. Jak 2 with the same .glb 2026-07-20.14-05-48.mp4Jak 3 with the same .glb (identical appearance to Jak 2) 2026-07-20.14-07-37.mp4 |
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.
Log messages are concise and very informative: