DirectionalLight

At the current moment, the only way to control the direction of lighting is by formulas to set the sun’s position through TimeOfDay and GeographicLattitude.

While this works for a few positions in the daytime, if you want the sun to come from a horizontal or downward source, it will start to get darker and take on the properties of moonlight.

DirectionalLights are used in game engines such as the Unreal Engine


A DirectionalLight would change the global direction of illumination, as well as the brightness and light source color settings based on the CFrame of the part that it would be inside of.

This feature would be really useful for games that take place in unusual settings, such as space games where there is no “up” direction.

63 Likes

I support. You should re-upload the picture with neon for those arrows and stuff, though. I missed them the first time around!

4 Likes

I very much support this suggestion.

My spaceship game will benefit visually from this, imagine a star system where spaceships can fly freely, in some cases they may fly directly above the star and this is a problem because there’s no way to achieve a downward source of global illumination.

4 Likes

I have to agree with this!

I’d much rather have a directional light source that would allow us to quickly and easily set up how we want our game’s “sunlight” to look!

4 Likes

Support!

Having DirectionalLight and some sort of new lighting for suns is something that I really want in some universal or quirky games, horizontally speaking, I guess this can also world in some other games that can use this with some realistic lighting. :eyes:

↓ Some quotes that I agree with for this to be added:

Along with this, I do hope that there could be more features to lighting and possibly more Technology or Lighting properties/settings that can expand what we can use it for and make with it.

I do see this happening in the future if it ever gets viewed from a lot of users and possibly Roblox staff, which would help out a lot of developers one day, very beneficial if you ask me. :3

5 Likes

Can we still not do this?.. It’s unsettling and a mark against roblox as a real game engine that the only way to make the light source from below is using the very funky day/night system.

I advise a full overhaul:

  • Ability to turn off ‘Moon lighting’ (Makes moon act as normal sunlight, for maximum control)
  • Optional ability to specify a ‘Night Skybox’
    (Dynamic stars in skyboxes are cool, but pointless when it means you are forced to use a pitch black skybox when night hits, fading out YOUR skybox!)
  • Option to use a Light Direction options that completely over-rides the direction of the sun/moon when used, or just uses sun direction when not specified.

These all seem exceptionally easy, useful, and IMO, could be implemented WITHOUT breaking ANY functionality for older games! (These are all settings that can be left un-specified and will work like before when default.)

Come on roblox, you really want to be a big game engine - this is one you’ll need.

5 Likes

Maybe there could be two DirectionalLights under Lighting by default (maybe not literally under, maybe just 2 properties) to represent the moon and the sun, which the TimeOfDay and GeographicalLatitude would control automatically. I think this would also fix the sudden snapping of lighting direction at specific times.

The only two hurdles I see is that on Android, there is simply no support for multiple shadowmapped light sources, only the single sun/moon amalgamation. We were supposed to get proper Future is Bright support in Mid 2023, but it was pushed back to somewhere in the middle of this year on the Roadmap. Perhaps this Feature Request is being stalled until then?

Then there’s also the question of how the literal Sun and Moon sprites would be represented. If you change the direction of the sun light source, would you expect the sprite to follow it?

I just wanted to share my 2c.

5 Likes

Then there’s also the question of how the literal Sun and Moon sprites would be represented. If you change the direction of the sun light source, would you expect the sprite to follow it?

I’d say it just over-rides it. If you wanted the direction of the sun/moon you’d just leave it blank realistically, otherwise you can calculate it yourself if you still need it to follow something perhaps

Having two specific sources of light, sun and moon, is an interesting concept, but realistically I’m fine with it being single-sourced so long as I can control that source better. The more the better of course, though!

2 Likes

Bump.
I am working on a project involving accurate astrological occurrences such as Solstices and latitude affecting sunrise and sunset times which is very difficult to workaround using the default roblox sun system (persistent sunrise and sunset at 6 am and 6 pm respectively).
I would like to create a custom one, but without directional lights I still have to use the default system for sunlight.

Also it is currently impossible to change the color of sunlight without using a color correction effect.

2 Likes

I also strongly support this suggestion. As other people have said, this has a strong use case in space games where the sun may be located in any direction, including from below. I have been working with a similar use case, and the lack of control over the behavior of the sun is extremely frustrating as there are no good alternatives for a global directional light and positioning the sun sprite to an arbitrary position. As a result, the player’s freedom of movement in the world may need to be restricted to a plane that won’t result in the sun going below the XZ plane. Not a very enjoyable restriction in a 3D game.

For my use case, having a restriction of a single directional light would be acceptable if there are performance reasons for not allowing multiple global light sources.

2 Likes

we REQUIRE this immediately.

Love this idea, would be useful

Seems like an actually necessary feature.