Hi everyone! I’m a Blender user, and I use Blackbody Radiation a lot when designing lighting because it makes it a lot easier to handle colour temperatures without having to faff about with RGB or HSV values.
How can I create a shader or script that allows me to colour lights with colour temperatures? There don’t seem to be any addons in the Asset Library for this as well.
I apologise if this is in the wrong category as well, this is my first post and the Shaders category seems to be the most fitting.
The problem with blackbody is it’s a pretty complex computation for a game. You could find a (GLSL) shader that does it and just use it in godot, then bake it with GI probe. That’s the best I can tell you because I haven’t used blackbody much, but PBR shaders are not magic. Just grab a minimal example and put it into godot. It should just work (might be very slow).
Edit: I’ve tried removing the early return in the function linked above, modifying _validate_property() to expose the property then recompiling, and it works. That said, it’s noted in another comment that the default value of 6500.0 is nearly white, and not completely white. Since it acts as a multiplier for the light color, we’d need to ensure it’s actually white if physical light units are disabled (perhaps by special-casing the value 6500.0).
UPDATE: There is an addon for Godot 4.1+ called Light Tools, found in the Asset Library and at this GitHub link that converts a colour temperature to RGB values, achieving the same thing but without any of the PBR performance concerns.