diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e5e3958 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,32 @@ +*.2da text +*.baf text +*.bat text eol=crlf +*.d text +*.html text +*.sh text eol=lf +*.tp2 text +*.tph text +*.tra text +*.txt text + +*.7z binary +*.are binary +*.bam binary +*.bmp binary +*.cre binary +*.dll binary +*.eff binary +*.exe binary +*.itm binary +*.jpg binary +*.mbc binary +*.png binary +*.pro binary +*.pvrz binary +*.spl binary +*.sto binary +*.tbc binary +*.vef binary +*.vvc binary +*.wav binary +*.wed binary diff --git a/LightingPack/languages/english/setup.tra b/LightingPack/languages/english/setup.tra new file mode 100644 index 0000000..9ceb2c2 --- /dev/null +++ b/LightingPack/languages/english/setup.tra @@ -0,0 +1,43 @@ +@1 = ~Shader script files for lighting control~ +@2 = ~This mod requires BG:EE or BG2:EE to be installed.~ +@3 = ~You need BG:EE v1.2 or higher for this mod to work.~ + +@100 = ~Neutral settings for contrast, brightness and gamma~ + +@101 = ~Slightly increased contrast, brightness and gamma~ +@102 = ~Moderately increased contrast, brightness and gamma (recommended)~ +@103 = ~Greatly increased contrast, brightness and gamma~ +@104 = ~Slightly reduced contrast, brightness and gamma~ +@105 = ~Moderately reduced contrast, brightness and gamma~ + +@106 = ~Slightly increased contrast~ +@107 = ~Moderately increased contrast~ +@108 = ~Greatly increased contrast~ +@109 = ~Slightly reduced contrast~ +@110 = ~Moderately reduced contrast~ + +@111 = ~Slightly increased brightness~ +@112 = ~Moderately increased brightness~ +@113 = ~Greatly increased brightness~ +@114 = ~Slightly reduced brightness~ +@115 = ~Moderately reduced brightness~ + +@116 = ~Slightly increased gamma~ +@117 = ~Moderately increased gamma~ +@118 = ~Greatly increased gamma~ +@119 = ~Slightly reduced gamma~ +@120 = ~Moderately reduced gamma~ + +@121 = ~Enter lighting values manually~ + +@200 = ~Enter a value for contrast (number >= 0.0, neutral=1.0):~ +@201 = ~Enter a value for brightness (number in interval [-1.0, 1.0], neutral=0.0):~ +@202 = ~Enter a value for gamma (number > 0.0, neutral=1.0):~ +@203 = ~The following values have been entered:~ +@204 = ~Contrast = %contrast%~ +@205 = ~Brightness = %brightness%~ +@206 = ~Gamma = %gamma%~ +@207 = ~Are the values correct [y/n/c]?~ +@208 = ~Are the values correct? (Enter y for yes, n for no or c for cancel):~ + +@300 = ~Installation cancelled by user.~ diff --git a/LightingPack/languages/polish/setup.tra b/LightingPack/languages/polish/setup.tra new file mode 100644 index 0000000..792640d --- /dev/null +++ b/LightingPack/languages/polish/setup.tra @@ -0,0 +1,43 @@ +@1 = ~Pliki skryptowe shaderow dla kontroli oswietlenia~ +@2 = ~Mod ten wymaga zainstalowania BG:EE lub BG2:EE.~ +@3 = ~Do dzialania tego moda niezbedne jest zainstalowanie BG:EE w wersji 1.2 lub wyzszej.~ + +@100 = ~Neutralne ustawienia poziomu kontrastu, jasnosci i korekcji gamma~ + +@101 = ~Nieznacznie zwiekszone poziomy kontrastu, jasnosci i korekcji gamma~ +@102 = ~Srednio zwiekszone poziomy kontrasu, jasnosci i korekcji gamma (zalecane)~ +@103 = ~Znacznie zwiekszone poziomy kontrastu, jasnosci i korekcji gamma~ +@104 = ~Nieznacznie zmniejszone poziomy kontrastu, jasnosci i korekcji gamma~ +@105 = ~Srednio zmniejszone poziomy kontrastu, jasnosci i korekcji gamma~ + +@106 = ~Nieznacznie zwiekszony poziom kontrastu~ +@107 = ~Srednio zwiekszony poziom kontrastu~ +@108 = ~Znacznie zwiekszony poziom kontrastu~ +@109 = ~Nieznacznie zmniejszony poziom kontrastu~ +@110 = ~Srednio zmniejszony poziom kontrastu~ + +@111 = ~Nieznacznie zwiekszony poziom jasnosci~ +@112 = ~Srednio zwiekszony poziom jasnosci~ +@113 = ~Znacznie zwiekszony poziom jasnosci~ +@114 = ~Nieznacznie zmniejszony poziom jasnosci~ +@115 = ~Srednio zmniejszony poziom jasnosci~ + +@116 = ~Nieznacznie zwiekszony poziom korekcji gamma~ +@117 = ~Srednio zwiekszony poziom korekcji gamma~ +@118 = ~Znacznie zwiekszony poziom korekcji gamma~ +@119 = ~Nieznacznie zmniejszony poziom korekcji gamma~ +@120 = ~Srednio zmniejszony poziom korekcji gamma~ + +@121 = ~Wprowadz recznie wartosci oswietlenia~ + +@200 = ~Wprowadz wartosc poziomu kontrastu (liczba >= 0.0, neutralna=1.0):~ +@201 = ~Wprowadz wartosc poziomu jasnosci (liczba z przedzialu [-1.0, 1.0], neutralna=0.0):~ +@202 = ~Wprowadz wartosc poziomu korekcji gamma (liczba > 0.0, neutralna=1.0):~ +@203 = ~Wprowadzono nastepujace wartosci:~ +@204 = ~Kontrast = %contrast%~ +@205 = ~Jasnosc = %brightness%~ +@206 = ~Gamma = %gamma%~ +@207 = ~Czy podane wartosci sa prawidlowe [y/n/c]?~ +@208 = ~Czy podane wartosci sa prawidlowe? (Wcisnij y dla tak, n dla nie, lub c aby przerwac):~ + +@300 = ~Instalacja przerwana przez uzytkownika.~ diff --git a/LightingPack/lib/functions.tph b/LightingPack/lib/functions.tph new file mode 100644 index 0000000..5c66916 --- /dev/null +++ b/LightingPack/lib/functions.tph @@ -0,0 +1,72 @@ +// WeiDU functions + +// Extends existing files +DEFINE_ACTION_FUNCTION InstallLighting +STR_VAR + contrast = "1.0" + brightness = "0.0" + gamma = "1.0" +BEGIN + // arguments must be valid numbers + ACTION_IF NOT ((~%contrast%~ STRING_MATCHES_REGEXP ~-?[0-9]+\(\.[0-9]+\)?$~) || + (~%brightness%~ STRING_MATCHES_REGEXP ~-?[0-9]+\(\.[0-9]+\)?$~) || + (~%gamma%~ STRING_MATCHES_REGEXP ~-?[0-9]+\(\.[0-9]+\)?$~)) BEGIN +// shader scripts will be prepended by the following text +<<<<<<<< LightingPack/inlined/functions.glsl +// Use the same values in all affected GLSL files for best results. +const lowp float a7contrast = %contrast%; // modify to adjust contrast (default: 1.0, lower: <1.0, higher: >1.0) +const lowp float a7brightness = %brightness%; // modify to adjust brightness (default: 0.0, darker: <0.0, brighter: >0.0) +const lowp float a7gamma = %gamma%; // modify to adjust gamma correction (default: 1.0, darker: <1.0, brighter: >1.0) + +vec3 a7ContrastFilter( vec3 color ) +{ + if (a7contrast != 1.0) + color = ( ( color - 0.5 ) * max( a7contrast, 0.0 ) ) + 0.5; + return color; +} + +vec3 a7BrightnessFilter( vec3 color ) +{ + if (a7brightness != 0.0) + color += a7brightness; + return color; +} + +vec3 a7GammaFilter( vec3 color ) +{ + if (a7gamma != 1.0) + color = pow( color, vec3( 1.0 / a7gamma ) ); + return color; +} + +vec4 a7ApplyFilters( vec4 color ) +{ + // applying contrast + color.rgb = a7ContrastFilter(color.rgb); + + // applying brightness + color.rgb = a7BrightnessFilter(color.rgb); + + // applying gamma + color.rgb = a7GammaFilter(color.rgb); + + // finalizing pixel data + return vec4( color.rgb, color.a ); +} + + +>>>>>>>> + + // Adjusting shader return values only, for max. mod compatibility + ACTION_FOR_EACH file IN ~fpDraw.GLSL~ ~fpTone.GLSL~ ~fpYUV.GLSL~ ~fpYUVGRY.GLSL~ BEGIN + ACTION_IF (FILE_EXISTS_IN_GAME ~%file%~) BEGIN + COPY_EXISTING ~%file%~ ~override~ + INSERT_FILE 0 ~LightingPack/inlined/functions.glsl~ + REPLACE_TEXTUALLY EVALUATE_REGEXP + ~gl_FragColor\(.+\)~ + ~vec4 a7FragColor\1%LNL% gl_FragColor = a7ApplyFilters( a7FragColor );~ + EVALUATE_BUFFER + END + END + END +END diff --git a/LightingPack/preview/lighting_preview.jpg b/LightingPack/preview/lighting_preview.jpg new file mode 100644 index 0000000..96a685d Binary files /dev/null and b/LightingPack/preview/lighting_preview.jpg differ diff --git a/LightingPack/readme/readme.polish.txt b/LightingPack/readme/readme.polish.txt new file mode 100644 index 0000000..b418126 --- /dev/null +++ b/LightingPack/readme/readme.polish.txt @@ -0,0 +1,77 @@ +Opcje dostosowywania Shader Pack: Lightning dla Edycji Rozszerzonych +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Wersja: 2.2 +Autor: argent77 +Pobierać z: http://www.shsforums.net/files/file/1080-lighting-pack-shader-scripts-for-the-enhanced-edition/ + + +1. Wstęp +~~~~~~~~ + +Oryginalne wersje gier opartych na silniku Infinity Engine posiadały opcje korygowania jasności i kontrastu, które były niezwykle przydatne, zwłaszcza w ciemnych lokacjach lub w nocy. Niestety opcje te zostały usunięte w Edycjach Rozszerzonych tych gier. + +Mod ten przywraca możliwość kontroli poziomu jasności, kontrastu i korekcji gamma. +Możesz wybrać opcję z zestawu predefiniowanych konfiguracji oświetlenia lub wprowadzić pożądane wartości ręcznie. + +Jeśli chcesz mieć ogólny pogląd jak dane ustawienia mają się do tych oryginalnych, wejdź w folder preview tego moda i otwórz przy pomocy dowolnej przeglądarki graficznej lub internetowej plik o nazwie "lighting_preview.jpg". + + +2. Instalacja +~~~~~~~~~~~~~ + +Mod ten wykorzystuje WeiDU podczas instalacji. Aby go zainstalować uruchom po prostu plik setup-LightingPack.exe (lub jego odpowiednik dla systemu OS), a następnie kieruj się instrukcjami pojawiającymi się na ekranie. + +Jeżli planujesz przeinstalowanie skryptów shadera przy użyciu innych ustawień, jest wysoce wskazane, abyś zainstalował ten mod najpóźniej, jak to możliwe. W rozdziale 5 znajdziesz informacje na temat ręcznej modyfikacji skryptów. + +Ważne: Aby ujrzeć efekty działania moda musisz mieć zainstalowane BG:EE w wersji 1.2 lub wyższej! + + +3. Odinstalowywanie i Przeinstalowywanie +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Uruchom po prostu plik setup-LightingPack.exe i ponownie kieruj się wskazówkami pojawiającymi się na ekranie. + + +4. Kompatybilność i Rozwiązywanie problemów +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Mod ten ma w zamierzeniu dokonywać jak najmniej zmian w plikach skryptów, tak aby zachować maksymalną kompatybilność z innymi modami ingerującymi w odpowiednie skrypty shaderów. Istnieje niewielka szansa, że mod ten nie będzie działał prawidłowo, jeśli inne mody dokonały niekompatybilnych zmian w plikach skryptów. W takim przypadku, zainstaluj ten mod jako pierwszy. + +Ręczna modyfikacja shaderów może spowodować wystąpienie błędów, które spowodują, że gra stanie się niegrywalna. +Jeżeli po uruchomieniu gry ujrzysz czarny ekran lub zniekształcone piksele, wciśnij Alt+F4 lub odpowiadający tej kombinacji skrót w przypadku systemu OS, aby wyjść z gry i naprawić błąd. +Jeżeli nie będziesz w stanie ręcznie naprawić plików, możesz w dowolnej chwili przeinstalować mod. + + +5. Jak modyfikować wartości oświetlenia po instalacji? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Jeśli zechcesz zmienić któreś z ustawień już po zainstalowaniu tego moda, odpowiednie pliki (patrz niżej) znajdziesz w folderze override. + +Pliki shaderów to zwykłe pliki tekstowe. Aby dostosować do swoich potrzeb poziom jasności, kontrastu lub korekcji gamma otwórz odpowiednie pliki w dowolnym edytorze tekstowym (np. Notepadzie) i zmodyfikuj zmienne oznaczone jako "jasność", "kontrast" i "gamma", znajdujące się w górnej części każdego skryptu. Każdy z plików shaderów zawiera krótki komentarz wyjaśniający jak ustawić odpowiednie wartości. W celu uzyskania najlepszych rezultatów zmienne we wszystkich trzech plikach shaderów powinny mieć tę samą wartość. + +Zastosowanie plików shaderów w grze: +fpDraw.GLSL Wykorzystywany we wszystkich kolorowych obszarach ekranu, z wyjątkiem filmów. +fpTone.GLSL Wykorzystywany we wszystkich obszarach ekranu o różnym stopniu szarości (np. przy nieaktywnych przyciskach czy efekcie zatrzymania czasu). +fpYUV.GLSL Wykorzystywany podczas odtwarzaniu filmów. +fpYUVGRY.GLSL Wykorzystywane dla wyjścia wideo w trybie odcieni szarości (obecnie używane jedynie w BG2:EE). + + +6. Version History +~~~~~~~~~~~~~~~~~~ + +v2.2 (2014-12-11) +- Added support for latest BG2:EE update + +v2.1 (2014-12-09) +- Fixed an issue regarding semi-transparent pixels + +v2.0 (2014-11-09) +- Greatly improved compatibility with third-party mods making changes to the shader files +- Added IWDEE support + +v1.1 (2014-01-20) +- Added polish translation (by Cahir) + +v1.0 (2014-01-17) +- Initial release diff --git a/LightingPack/readme/readme.txt b/LightingPack/readme/readme.txt new file mode 100644 index 0000000..b18685e --- /dev/null +++ b/LightingPack/readme/readme.txt @@ -0,0 +1,94 @@ +Shader Pack: Lighting adjustments for the Enhanced Edition +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Version: 2.2 +Author: argent77 +Download from: http://www.shsforums.net/files/file/1080-lighting-pack-shader-scripts-for-the-enhanced-edition/ + + +1. Introduction +~~~~~~~~~~~~~~~ + +The original Infinity Engine games provided options to adjust brightness and contrast which +helped a lot, especially in dark dungeons or at night time. Unfortunately these options have +been removed from the Enhanced Editions of the games. + +This mod provides a way to bring back the means to adjust brightness, contrast and gamma correction. +You can choose from a set of predefined lighting configurations or enter the desired values manually. + +If you want to get a general idea on how each setting looks compared to the original, go into the +preview folder of this mod and open the file "lighting_preview.jpg" with your graphics viewer +or browser. + + +2. Installation +~~~~~~~~~~~~~~~ + +This mod uses WeiDU for the installation. To install it, simply execute the file +setup-LightingPack.exe (or your OS-specific equivalent) and follow the instructions on screen. + +If you plan to re-install the shader scripts with different settings, it is highly recommended +to install this mod as late as possible. For modifying the scripts manually see chapter 5. + +Important: You need BG:EE v1.2 or higher to see any effect! + + +3. Uninstallation & Re-installation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Simply run setup-LightingPack.exe again and follow the instructions on screen. + + +4. Compatibility & Troubleshooting +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This mod attempts to make as few as possible changes to the script files to retain +max. compatibility with other mods that affect the respective shader scripts. +There is a small chance that this mod doesn't work correctly if other mods have +made incompatible changes to the script files. In that case you have to install this +mod first. + +When modifying shader files manually, there is a chance that it will introduce errors that +may cause the game to be unplayable. +If you see a black screen or garbled pixels when you start up the game, press Alt+F4 or the +respective default shortcut on your OS to quit the game and fix the error. +If you are unable to repair the files manually, you can re-install the mod at anytime. + + +5. How to modify lighting values after installation? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you want to change one or more settings after the mod has been installed, you can find +the respective files (see below) in the override folder of your game installation. + +Shader files are simple text files. To adjust the brightness, contrast and gamma correction +values to your needs, open the respective file in your text editor (e.g. Notepad) and modify +the variables labeled as 'brightness', 'contrast' and 'gamma' located in the upper section of +each script. The shader files contain short comments on how to set the values correctly. +You should set the variables in all three shader files to the same amount for best results. + +Usage of shader files in the game: +fpDraw.GLSL Used for every colored areas of the screen, except for videos. +fpTone.GLSL Used for grayscaled areas of the screen (e.g. disabled buttons or time stop effect). +fpYUV.GLSL Used for video output. +fpYUVGRY.GLSL Used for grayscaled video output (currently only used in BG2:EE). + + +6. Version History +~~~~~~~~~~~~~~~~~~ + +v2.2 (2014-12-11) +- Added support for latest BG2:EE update + +v2.1 (2014-12-09) +- Fixed an issue regarding semi-transparent pixels + +v2.0 (2014-11-09) +- Greatly improved compatibility with third-party mods making changes to the shader files +- Added IWDEE support + +v1.1 (2014-01-20) +- Added polish translation (by Cahir) + +v1.0 (2014-01-17) +- Initial release diff --git a/LightingPack/setup-LightingPack.tp2 b/LightingPack/setup-LightingPack.tp2 new file mode 100644 index 0000000..122ae3f --- /dev/null +++ b/LightingPack/setup-LightingPack.tp2 @@ -0,0 +1,252 @@ +BACKUP ~LightingPack/backup~ +AUTHOR ~Argent77 at Spellhold Studios Forum~ +VERSION ~v2.2~ + +README ~LightingPack/readme/readme.%LANGUAGE%.txt~ ~LightingPack/readme/readme.txt~ + +LANGUAGE ~English~ ~english~ ~LightingPack/languages/english/setup.tra~ +LANGUAGE ~Polski (tlumaczenie: Cahir)~ ~polish~ ~LightingPack/languages/english/setup.tra~ ~LightingPack/languages/polish/setup.tra~ + +// Neutral settings +BEGIN @100 // Neutral settings for contrast, brightness and gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "0.0" gamma = "1.0" END + +// slight overall increase +BEGIN @101 // Slightly increased contrast, brightness and gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.1" brightness = "0.05" gamma = "1.05" END + +// moderate overall increase +BEGIN @102 // Moderately increased contrast, brightness and gamma (recommended) + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.2" brightness = "0.1" gamma = "1.1" END + +// great overall increase +BEGIN @103 // Greatly increased contrast, brightness and gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.4" brightness = "0.2" gamma = "1.2" END + +// slight overall decrease +BEGIN @104 // Slightly reduced contrast, brightness and gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "0.9" brightness = "-0.05" gamma = "1.0" END + +// moderate overall decrease +BEGIN @105 // Moderately reduced contrast, brightness and gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "0.8" brightness = "-0.1" gamma = "0.9" END + +// slight contrast increase +BEGIN @106 // Slightly increased contrast + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.05" brightness = "0.0" gamma = "1.0" END + +// moderate contrast increase +BEGIN @107 // Moderately increased contrast + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.1" brightness = "0.0" gamma = "1.0" END + +// great contrast increase +BEGIN @108 // Greatly increased contrast + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.2" brightness = "0.0" gamma = "1.0" END + +// slight contrast decrease +BEGIN @109 // Slightly reduced contrast + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "0.9" brightness = "0.0" gamma = "1.0" END + +// moderate contrast decrease +BEGIN @110 // Moderately reduced contrast + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "0.8" brightness = "0.0" gamma = "1.0" END + +// slight brightness increase +BEGIN @111 // Slightly increased brightness + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "0.05" gamma = "1.0" END + +// moderate brightness increase +BEGIN @112 // Moderately increased brightness + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "0.1" gamma = "1.0" END + +// great brightness increase +BEGIN @113 // Greatly increased brightness + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "0.2" gamma = "1.0" END + +// slight brightness decrease +BEGIN @114 // Slightly reduced brightness + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "-0.05" gamma = "1.0" END + +// moderate brightness decrease +BEGIN @115 // Moderately reduced brightness + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "-0.1" gamma = "1.0" END + +// slight gamma increase +BEGIN @116 // Slightly increased gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "0.0" gamma = "1.1" END + +// moderate gamma increase +BEGIN @117 // Moderately increased gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "0.0" gamma = "1.2" END + +// great gamma increase +BEGIN @118 // Greatly increased gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "0.0" gamma = "1.4" END + +// slight gamma decrease +BEGIN @119 // Slightly reduced gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "0.0" gamma = "0.9" END + +// moderate gamma decrease +BEGIN @120 // Moderately reduced gamma + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = "1.0" brightness = "0.0" gamma = "0.8" END + +// manual input +BEGIN @121 // Enter values for contrast, brightness and gamma manually + REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @2 // This mod requires BG:EE or BG2:EE to be installed. + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~fpDraw.GLSL~ @3 // You need BG:EE v1.2 or higher for this mod to work. + SUBCOMPONENT @1 // Install shader files for lighting control (BG:EE or BG2:EE) + + OUTER_TEXT_SPRINT confirm "n" + OUTER_WHILE (~%confirm%~ STRING_EQUAL_CASE ~n~) || (~%confirm%~ STRING_EQUAL_CASE ~no~) BEGIN + // input contrast + PRINT @200 // Enter a value for contrast (a real number >= 0.0, neutral=1.0): + ACTION_READLN contrast + OUTER_WHILE (~%contrast%~ STRING_MATCHES_REGEXP ~-?[0-9]+\(\.[0-9]+\)?$~) BEGIN + PRINT @200 // Enter a value for contrast (a real number >= 0.0, neutral=1.0): + ACTION_READLN contrast + END + + // input brightness + PRINT @201 // Enter a value for brightness (a real number in interval [-1.0, 1.0], neutral=0.0): + ACTION_READLN brightness + OUTER_WHILE (~%brightness%~ STRING_MATCHES_REGEXP ~-?[0-9]+\(\.[0-9]+\)?$~) BEGIN + PRINT @201 // Enter a value for brightness (a real number in interval [-1.0, 1.0], neutral=0.0): + ACTION_READLN brightness + END + + // input gamma + PRINT @202 // Enter a value for gamma (a real number > 0.0, neutral=1.0): + ACTION_READLN gamma + OUTER_WHILE (~%gamma%~ STRING_MATCHES_REGEXP ~-?[0-9]+\(\.[0-9]+\)?$~) || NOT (~%gamma%~ STRING_MATCHES_REGEXP ~-?0\(\.0+\)?$~) BEGIN + PRINT @202 // Enter a value for gamma (a real number > 0.0, neutral=1.0): + ACTION_READLN gamma + END + + // print summary + PRINT @203 // The following values have been entered: + PRINT @204 // Contrast = + PRINT @205 // Brightness = + PRINT @206 // Gamma = + + PRINT @207 // Are the values correct [y/n/c]? + ACTION_READLN confirm + OUTER_WHILE NOT ((~%confirm%~ STRING_EQUAL_CASE ~n~) || (~%confirm%~ STRING_EQUAL_CASE ~no~) || + (~%confirm%~ STRING_EQUAL_CASE ~y~) || (~%confirm%~ STRING_EQUAL_CASE ~yes~) || + (~%confirm%~ STRING_EQUAL_CASE ~c~) || (~%confirm%~ STRING_EQUAL_CASE ~cancel~)) BEGIN + PRINT @208 // Are the values correct? (Enter y for yes, n for no or c for cancel): + ACTION_READLN confirm + END + ACTION_IF (~%confirm%~ STRING_EQUAL_CASE ~c~) || (~%confirm%~ STRING_EQUAL_CASE ~cancel~) BEGIN + FAIL @300 // User has cancelled installation. + END + END + + INCLUDE ~LightingPack/lib/functions.tph~ + LAF InstallLighting STR_VAR contrast = EVALUATE_BUFFER ~%contrast%~ brightness = EVALUATE_BUFFER ~%brightness%~ gamma = EVALUATE_BUFFER ~%gamma%~ END + diff --git a/README.md b/README.md new file mode 100644 index 0000000..6d16aee --- /dev/null +++ b/README.md @@ -0,0 +1,68 @@ +#Shader Pack: Lighting adjustments for the Enhanced Edition + +**Author:** Argent77 + + +##Introduction + +The original Infinity Engine games provided options to adjust brightness and contrast which +helped a lot, especially in dark dungeons or at night time. Unfortunately these options have +been removed from the Enhanced Editions of the games. + +This mod provides a way to bring back the means to adjust brightness, contrast and gamma correction. +You can choose from a set of predefined lighting configurations or enter the desired values manually. + +If you want to get a general idea on how each setting looks compared to the original, go into the +preview folder of this mod and open the file "lighting_preview.jpg" with your graphics viewer +or browser. + + +##Installation + +This mod uses WeiDU for the installation. To install it, simply execute the file `setup-LightingPack.exe` +(or your OS-specific equivalent) and follow the instructions on screen. + +If you plan to re-install the shader scripts with different settings, it is highly recommended +to install this mod as late as possible. For modifying the scripts manually see chapter 5. + +**Important:** You need BG:EE v1.2 or higher to see any effect! + + +##Uninstallation & Re-installation + +Simply run `setup-LightingPack.exe` again and follow the instructions on screen. + + +##Compatibility & Troubleshooting + +This mod attempts to make as few as possible changes to the script files to retain +max. compatibility with other mods that affect the respective shader scripts. +There is a small chance that this mod doesn't work correctly if other mods have +made incompatible changes to the script files. In that case you have to install this +mod first. + +When modifying shader files manually, there is a chance that it will introduce errors that +may cause the game to be unplayable. +If you see a black screen or garbled pixels when you start up the game, press Alt+F4 or the +respective default shortcut on your OS to quit the game and fix the error. +If you are unable to repair the files manually, you can re-install the mod at anytime. + + +##How to modify lighting values after installation? + +If you want to change one or more settings after the mod has been installed, you can find +the respective files (see below) in the override folder of your game installation. + +Shader files are simple text files. To adjust the brightness, contrast and gamma correction +values to your needs, open the respective file in your text editor (e.g. Notepad) and modify +the variables labeled as 'brightness', 'contrast' and 'gamma' located in the upper section of +each script. The shader files contain short comments on how to set the values correctly. +You should set the variables in all three shader files to the same amount for best results. + +Usage of shader files in the game: +``` +fpDraw.GLSL Used for every colored areas of the screen, except for videos. +fpTone.GLSL Used for grayscaled areas of the screen (e.g. disabled buttons or time stop effect). +fpYUV.GLSL Used for video output. +fpYUVGRY.GLSL Used for grayscaled video output (currently only used in BG2:EE). +```