Advanced Daylight System with Colour Grading

HI Guys ,

I am currently working on Colour grading based on time of day. The plan is to make a complete blueprint based day light system that will keep changing the colour grading texture based on the game time of day and in given interval. So far I have created 15 main LUTs according to different times of day, and I have a plan to create 10-15 LUTs for every pair of adjacent primary LUTs , so that when the LUTs are changing during gameplay , the blend will look more realistic.

Here are few screenshots of the main LUTs -





Few Blending LUTs from Night to Dawn

Couple of Blending LUTs from Dawn to Early Sunlight

Being a programmer , I do not have the proficiency of creating outstanding textures. So if you find any of the textures not so good , let me know , I will try my best to improve the quality.
I also have a plan to create few location based LUTs, that can be used along with time based LUTs to get more realistic look.

sweet:cool:

Looks good, nicely done.

This looks great, great use of the color grading system, may I ask how you are achieving the blend between grading images?

For now , I am manually creating a blend one by one , but I am trying to dynamically create adjustments for the textures so that the blends will look more realistic over time. I thought this method might be helping me but apparently it throws runtime error

I like Early Night and One Hour After sunrise the most. Some of them feel a bit too strongly tinted to me (like Early Sunset) Interested to see your system motion!

You could also make 15 unbound postprocess volumes and blend them programmatically or using blueprints using the blend parameter

I was thinking about how to do this just the other day, nice job so far!

Thanks for your feedback. I will merge this with location based daylight system so that clouds and sunlight are in pace with the LUTs , and then will make a video of this.

Systems like this for me are almost a must. I am not color blind but I might as well be as I seem to have no attention depth regarding colors. So for me, having pre-made color based systems is really important.
But what I am wondering, is if I could use this system for a 2D project that runs on emissive lighting? I do not have much experience in the lighting department or texturing so forgive me if this is unrelated.

Otherwise, great work, looks good, and useful!

This is cool looking forward to seeing video in action.

By the way , how exactly are you going about this? … if you don’t mind my asking. I imagined doing it with simple matinee and blueprint and making the individual “steps” manually in photoshop, starting off with several major “steps” and then just blending the resulting color tables a set number of “steps” between each major step, maybe making them total a new LUT each hour or every 2 hours or something. If you have any ideas you’d be willing to share, I’d love to hear them. I don’t have much experience programming so my approach is fairly limited. Definitely going to follow this thread, very interested in seeing your results!

Well, that is exactly what I did minus the matinee thing. These are the three ways I can think of -

1>Creating approx 300 LUTs , the one you suggested, with 15 main LUTs and 10-20 different LUTs between each two main adjacent LUTs. Now how will I create those blend LUT textures? Simple - Create a material with two adjacent LUTs , create a Lerp with the Alpha as a scalar param and connect to basecolor. Create a material instance and increase the parameter by ,say .1 if you want to have 10 blend LUTs between every two main ones , and .05 if you want to have 20. See the instance preview in plane form , crop the picture of the plane using snipping tool, go to photoshop and resize the pic by 256 x 16, import the pic in LUT. Repeat this by increasing the parameter by .1 or .05, until you get all LUts you want. Considering the step as 1 min per LUT , you can pretty well create 10 LUTs in a bit over 10 minutes.

2>Create the material as mentioned above , only the textures are parameters this time. Create instances dynamically and pass the material in C++ code , from there you can take the material basecolor value, convert it into array of FColors(if only you know how to split a material basecolor into pixels and read those pixel values in RGB format. I couldn’t do this), and create a new texture using the below code -


UTexture2D* FinalTexture = FImageUtils::CreateTexture2D(256, 16, Colors, this, "ResultTexture", EObjectFlags::RF_Public | EObjectFlags::RF_Transient, FCreateTexture2DParameters())

Return this texture and connect the texture with the post process element’s color grading factor. Do this at every tick, adjust the scalar param value according to your game time, and you might get pretty decent blends.

3>What I think a more feasible option and inspired from .pareschi’s suggestion above, but am yet to try out - Create the post process elements dynamically as unbound , in begin play. Store them in an array. And then in tick event, based on the current time , bind the current post process element, and in the next tick , you can bind the next post process element, and increase the blend weight slightly above 0 and decrease the bend weight of the previous post process element slightly below 1. Repeat this every tick , and at one point the previous post process element will have 0 weight and current element will have 1 weight. This is the time when you unbind the previous element and bind the next element in the same way. This should create nice realistic blend , but I am yet to try it out , so can’t be sure of the results.

I can see what you meant based on your other post. I cannot be sure , but you can very easily try this out. Just drop one post process element in your scene and scale it to fill entire scene area , add any texture you have as colour grading texture , and increase the grading intensity. If you notice any difference , you can very easily use this system for your project as well.

Can’t you just blend different post process volumes over top each other? I don’t see the need for all the in between LUTs.

I was unable to do so , as two post process blends are not showing simultaneous effects when enabled simultaneously. Unless I get a better solution , I will create the blend textures. But the good news is , I don’t have to create them one by one. I have created an application in C# using OpenCV that does the linear blend for me. So literally I can create 1000s of LUT blends(20+ might be enough per hour to prevent human eye from noticing the change) in few clicks!!!

Have you tried using timelines to blend between them? I set up a blend in/out of a LUT with a timeline like this to test:

[video][/video]

If you defined the LUT with a variable and set the variable based on the time and made an event that played the timeline after redefining the LUT maybe that would work? It’s late and I don’t really know that much about this stuff but seems like it would work.

Thanks for the response , but I was also doing a calculation to blend the LUT based on sun’s elevation angle , it was working fine , what wasn’t was that the adjacent post process element , when set enabled, is not taking effect as long as the current post process element is active. So instead I created a .net application that takes two texture as inputs and use Lerp to blend them based on alpha parameter and save the new texture on hard disc. This way I can have 1000s of LUTs in minutes. (I tried creating blended textures dynamically in unreal engine C++ but that is giving very weird result , maybe because there is no easy way to create Pixelformat as DXT1(maybe there is , I just couldn’t find out)).

Hi ,

Finally I have managed to complete the day night cycle. Please watch a simple video demonstration. Kindly pardon my accent :frowning:

Few More Screenshots -