Author Topic: [FF7PC] Cosmos Lighting: a real-time lighting and shadow mod  (Read 22630 times)

Xezcente

  • *
  • Posts: 6
    • View Profile
I'm just gonna echo the sentiments of everyone when I say that this looks great! Thank you. Definitely a must have from now on.

Cosmos

  • *
  • Posts: 34
    • View Profile
Hey, I need a little noob help with this. I enabled the devtools (by switching the value to "true"), but nothing happens when I press F12 on my keyboard, other than putting notepad in fullscreen. What am I missing?

Thank you!

Once you set the devtools to "true" and save you should see the debug menu in the game window as in the screenshot below.



Then choose "Tools" -> "Lighting Debug" and you'll get the lighting debug options.

By the way, execute the game in windowed mode because at least in my case I cannot get the mouse to show in fullscreen mode.
Also, the "F12" shortcut is to toggle on and off the debug menu from the game window, not from notepad lol

AuthenticM

  • *
  • Posts: 148
    • View Profile
Also, the "F12" shortcut is to toggle on and off the debug menu from the game window, not from notepad lol

lmfao. Thank you.

So from reading further, this F12 debug menu seems to be used to modify the lighting feature in various ways, and not to activate or deactivate it, correct? It feels like the FFNx.toml file is where the feature would be toggled on or off, but my issue is that I can't find anything in that file that relates to the lighting feature. I have 7th Heaven 2.3.1.0 installed, as well as the latest stable version of FFNx (obtained from the 7th Heaven General Settings menu).

Is the lighting feature only available from the "canary" channel?

Cosmos

  • *
  • Posts: 34
    • View Profile
lmfao. Thank you.

So from reading further, this F12 debug menu seems to be used to modify the lighting feature in various ways, and not to activate or deactivate it, correct? It feels like the FFNx.toml file is where the feature would be toggled on or off, but my issue is that I can't find anything in that file that relates to the lighting feature. I have 7th Heaven 2.3.1.0 installed, as well as the latest stable version of FFNx (obtained from the 7th Heaven General Settings menu).

Is the lighting feature only available from the "canary" channel?

Yes, lighting is currently only available in the canary build so please check the link in the first post if you want to try it.

AuthenticM

  • *
  • Posts: 148
    • View Profile
Yes, lighting is currently only available in the canary build so please check the link in the first post if you want to try it.

Thank you, much appreciated.

Lollie

  • *
  • Posts: 9
    • View Profile
    • Lollie.me
Echoing the sentiments of everyone else here, this is a really cool mod. Very happy to see this. I hope FF7-PC can be configured/modded to take control of your lighting system, somehow!

Right now there is only one single directional light but it should not be too difficult to add support for point/spot lights. [...] I also read about the game already having some kind of lights (point lights?), so maybe we can use those because implementing a way to manually place lights would be a lot of work I think.
So.. I've asked about FF7's lighting before, and I ended up doing some testing over this weekend. What I found is that the way lighting works in FF7 isn't quite like you'd expect.

Here's a huge post with what I was able to figure out about lighting in FF7.

The short version is: Field models have one ambient color and three lighting channels, each with three axes. Each channel controls light intensity on a specific axis (it accepts positive and negative values, where "0" is the center of the range and represents zero strength), and then the actual light direction is determined based on the values of the three axes. Lights are local to each model. An NPC can move around, and their lighting will follow their position — but lighting on FF7-PC is affected by model rotation.




However, the way lighting is processed in FF7-PC is broken. The correct lighting data is still in the game, and it looks correct when the first lighting channel is isolated. But as far as I can tell, the PC version may be displaying *too much* lighting information, or maybe isn't blending the lighting correctly. (Model textures also don't receive lighting correctly. The most simple fix is for their brightness to be multiplied by 2 via shader.)

Unfortunately (or fortunately, if you want a clean slate to work with), there are no point lights in any of the scenes. There are foreground layers that are blended additively, but that's about it.
« Last Edit: 2021-07-21 04:55:03 by Lollie »

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
The light on PSX is backed on the models (to save computing time and memory) and the yxz calculation is different. The values don't seem to be displayed correctly on PC compared to PSX. You can see the wrong behavior on the worldmap on some 3D models like towns.

Cosmos

  • *
  • Posts: 34
    • View Profile
Echoing the sentiments of everyone else here, this is a really cool mod. Very happy to see this. I hope FF7-PC can be configured/modded to take control of your lighting system, somehow!

Thank you, I am glad you like it. About being able to configure the lighting settings, yes I will implement this in the future. But I won't do it until all parameters in the lighting settings are finalized. This is because I don't want anyone to start doing the hard work of customizing it for each field/battle and then have a change that breaks compatibility.


So.. I've asked about FF7's lighting before, and I ended up doing some testing over this weekend. What I found is that the way lighting works in FF7 isn't quite like you'd expect.

Here's a huge post with what I was able to figure out about lighting in FF7.

Thank you for this info.

Actually I did look into this light data like a month ago but was totally confused on how to use it. If I understand correctly this is like having 3 directional lights, each one having its direction along each of the X, Y, Z axis. I suppose that this is a very rough way to imitate global illumination instead of just having a constant ambient color that would look flat. This a very ad-hoc way of doing lighting so I am not really interested on replicating this way of doing lighting. This is not how lighting is done in modern games so I think we would do much better if we don't use this data at all. For indirect lighting, I am working on implementing Image Base Lighting( IBL) / environment maps.

Lollie

  • *
  • Posts: 9
    • View Profile
    • Lollie.me
If I understand correctly this is like having 3 directional lights, each one having its direction along each of the X, Y, Z axis. I suppose that this is a very rough way to imitate global illumination instead of just having a constant ambient color that would look flat. This a very ad-hoc way of doing lighting so I am not really interested on replicating this way of doing lighting. This is not how lighting is done in modern games so I think we would do much better if we don't use this data at all.
You understand it correctly! And honestly, considering the way you're doing lighting with this mod, I think ignoring this data will probably be the right call overall.

That said, I can think of one way to use the data. If you look at the first field model in a scene, and only use that model's *first* lighting channel, you might be able to use the first channel's values as the lighting direction for the scene's global light. It could be good as a starting point at least, and then lighting direction could be fine-tuned later. I have a suspicion that the first lighting channel is the only one that's actually important in most scenes.

For indirect lighting, I am working on implementing Image Base Lighting( IBL) / environment maps.
That'll be very cool, that's exciting. Wishing you good luck!

olearyf2525

  • *
  • Posts: 298
    • View Profile
New lighting feature incoming!

I implemented support for PBR textures such as normal map, roughness map, metalness map and AO map!
There is still no environment map but that is next in my list.



Beautiful work Cosmos. Have you seen this topic?
https://forums.qhimm.com/index.php?topic=20540.0;topicseen

Kuraudo.

  • SOLDIER
  • *
  • Posts: 354
  • Maktub
    • View Profile
    • Behemoth Productions
Just wanna say Everytime I pop in this topic there is some new stuff out of this planet.

Keep it up Cosmos! It's fantastic.

Cosmos

  • *
  • Posts: 34
    • View Profile
Beautiful work Cosmos. Have you seen this topic?
https://forums.qhimm.com/index.php?topic=20540.0;topicseen
Yes, I replied to the author of that topic just a little above your comment.

WolfMan

  • *
  • Posts: 372
  • One whos possessed by nothing possesses evrything
    • View Profile
I like these models. Where do I find them?

Chrysalis

  • ESUI Developer
  • Global moderator
  • *
  • Posts: 414
    • View Profile
It looks really awesome, I am really looking forward to playing the game with this on when its complete.

Cosmos

  • *
  • Posts: 34
    • View Profile
I like these models. Where do I find them?

You can download them here: https://www.nexusmods.com/finalfantasy7/mods/4?tab=files

Kuraudo.

  • SOLDIER
  • *
  • Posts: 354
  • Maktub
    • View Profile
    • Behemoth Productions
Great, can't wait to see more!
« Last Edit: 2022-10-09 19:23:13 by Kuraudo. »

Kuraudo.

  • SOLDIER
  • *
  • Posts: 354
  • Maktub
    • View Profile
    • Behemoth Productions
Excited for Image Base Lighting (IBL) / environment maps feature, can't imagine how awesome it will look. Also, the "Save light parameters per scene", could be an helpful super tool for mod purpose.

PS: FYI Bahamut Zero and Supernova are glitched atm. [SOLVED]
« Last Edit: 2023-09-19 17:45:57 by Kuraudo. »