Ben1138 / SWBF2Phoenix

A re-implementation of the old Star Wars Battlefront II (2005) game, utilizing the Unity game engine
GNU Affero General Public License v3.0
73 stars 12 forks source link

Directional Lights with Bounding Region #18

Open Ben1138 opened 2 years ago

Ben1138 commented 2 years ago

In ZE, you can place directional lights that are bound to a specific region, meaning the directional light will only be in effect within the bounds of that region, instead of globally. Here's an example on Mustafar of a directional light, color 255,255,255, being bound to a region called "walkway 2".

grafik

Unity doesn't have a possibility out of the box for directional lights to replicate that behaviour, instead we're currently disabling those lights, as they would emit everything globally otherwise:

grafik

Question is, how to approach this? Should we create our custom default shader that takes these lights into account and illuminate everything within the bounds of that region respectively? Or should we replace them with Area lights? Or make an array of Spotlights (please don't)?

WHSnyder commented 2 years ago

Perhaps there should be bigger issue (that depends on this one ofc) of how to support the different rendertypes/flags in one big ubershader?