project-navigation
Personal tools

Author Topic: Hotkey for enabling/disabling realtime lighting  (Read 3263 times)

Offline Edi

  • Squad Leader
  • ****
  • Posts: 296
    • View Profile
Hotkey for enabling/disabling realtime lighting
« on: May 30, 2010, 05:42:53 pm »
Would it be possible to map a hotkey for enabling and disabling realtime lighting? One that would work in both geoscape and battlescape?

With the black model problem of ATI cards and the workaround to it (disabling realtime lighting for the duration of combat in the battlescape), this hotkey would significantly reduce the annoyance of going to options, video options, turn off RTL, go back and then after battle go to options, video options, turn RTL back on and go back (unless you like playing on a transparent geoscape).

Instead of all that, it would take just pressing one key for off and the same key to on again and it would avoid the risk of accidentally clicking GLSL shaders off and then needing to restart the game after re-enabling them.

Pretty please?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Hotkey for enabling/disabling realtime lighting
« Reply #1 on: May 30, 2010, 06:34:11 pm »
bind r "set r_programs 0;"
bind f "set r_programs 1;"

Offline Edi

  • Squad Leader
  • ****
  • Posts: 296
    • View Profile
Re: Hotkey for enabling/disabling realtime lighting
« Reply #2 on: May 30, 2010, 06:39:21 pm »
bind r "set r_programs 0;"
bind f "set r_programs 1;"
This would go into the keys.cfg? And I could presumably use any keys I chose that are not already in use?

If so, thank you so very much!

Offline Edi

  • Squad Leader
  • ****
  • Posts: 296
    • View Profile
Re: Hotkey for enabling/disabling realtime lighting
« Reply #3 on: May 30, 2010, 06:57:50 pm »
Actually, that r_programs turns GLSL shaders on and off, but does nothing for real time lighting. Is it some other program variable that affects that? Because messing with the GLSL shaders requires restarts with an ATI card or things go screwy.

Offline Edi

  • Squad Leader
  • ****
  • Posts: 296
    • View Profile
Re: Hotkey for enabling/disabling realtime lighting
« Reply #4 on: May 30, 2010, 07:52:20 pm »
Never mind, found it. The variable that sets real time lighting on or off is r_lights.

Everything is quite excellent now! :D