[Skyrim/FO4] enb script extender

general download section
  • Author
  • Message
Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

[Skyrim/FO4] enb script extender



This is a SKSE plugin that adds following papyrus functions for creation kit script compiler to modify enb values on game events:

Code: Select all

int Function ENB_GetVersion() global native
int Function ENB_GetSDKVersion() global native

//file == "" (empty string) to access shader sections,  file == "enbseries.ini" to access enbseries sections.

//get values
float   Function ENB_GetFloat(      string file, string section, string keyname ) global native
int     Function ENB_GetInt(        string file, string section, string keyname ) global native
bool    Function ENB_GetBool(       string file, string section, string keyname ) global native
float[] Function ENB_GetColorRGB(   string file, string section, string keyname ) global native
float[] Function ENB_GetColorRGBA(  string file, string section, string keyname ) global native
float[] Function ENB_GetVector3(    string file, string section, string keyname ) global native

//set values
Function ENB_SetFloat( string file, string section, string keyname, float  value) global native
Function ENB_SetInt(   string file, string section, string keyname, int    value) global native
Function ENB_SetBool(  string file, string section, string keyname, bool   value) global native

Function ENB_SetColorRGB(  string file, string section, string keyname, float colorR, float colorG, float colorB)               global native
Function ENB_SetColorRGBA( string file, string section, string keyname, float colorR, float colorG, float colorB, float colorA) global native
Function ENB_SetVector3(   string file, string section, string keyname, float _x,     float _y,     float _z)                   global native

//set parameters in ini file under "\enbseries\profiles\filename.ini"
Function ENB_SetConfigFile( string filename) global native
demo script: (not included in the download)

Code: Select all

Scriptname testscript extends ObjectReference  
{test}

import ENBscript

Message Property ENBtestMSG auto

Event OnActivate(ObjectReference akActionRef)

//set letterbox under [ENBEFFECT.FX] to 9.0 in shader window
    ENB_SetFloat("", "ENBEFFECT.FX", "letterbox", 9.0 )

//load settings in "/enbseries/profiles/test.ini"
    ENB_SetConfigFile("test.ini") 
    
//get colorRGB  "DirectLightingColorFilterDawn" under [ENVIRONMENT] in enbseries.ini
    float[] color = new float[3]
    color = ENB_GetColorRGB("enbseries.ini", "ENVIRONMENT", "DirectLightingColorFilterDawn")

//get single float "GammaCurve" under [COLORCORRECTION] in enbseries.ini.
    float enbfloat = ENB_GetFloat("enbseries.ini", "COLORCORRECTION", "GammaCurve")


    ENBtestMSG.show(enbfloat, color[0], color[1], color[2])
endEvent
for the config files, it looks like this:
"test.ini"

Code: Select all

[EFFECT.TXT]
CameraState=5
FOV=5.0
btest=true
[GLOBAL]
UseEffect=true
[ENBBLOOM.FX]
somecolor=0.77, 0.5, 0.3
somecolorRGBA=0.77, 0.5, 0.3, 0.0
somevector=0.34, 1.5, 2.2, v
someint=-4
somebool=false
Also, a log file is generated in /my games/skyrim/skse
enb script extender.zip
***BETA***
(83.37 KiB) Downloaded 578 times

===============================================


Fallout 4 :
with two additional functions:

Code: Select all

Function ENB_unSetConfigFile() global native ;revert back to the settings that are replaced by ENB_SetConfigFile
Function ENB_SetConfigFile_Interpolate( string file, float w) global native ;interpolate between current settings and config file by weight.
And a button to save current settings to .ini profile.


**Note
For config files to work properly, the UI widget names can not be start with space.

Add this line to enbeffectpostpass.fx for the profile saver to work.

Code: Select all

bool SaveProfile  <string UIName="Save Current Profile"; > = {false};
ENB script extender FO4 v3.fixed.zip
for F4SE 0.3.0+ (fixed)
(107.24 KiB) Downloaded 394 times
example script for weather dependent profile

Code: Select all

Scriptname ENBweatherTest extends Quest
import ENBscript

Weather Property CommonwealthRain auto 

Event OnInit()
	StartTimer(0.02)
EndEvent

Event OnTimer(int aiTimerID)

	Weather Curr

	If aiTimerID == 0
		Curr  = Weather.GetCurrentWeather()
		float curTransition = Weather.GetCurrentWeatherTransition();

		if Curr == CommonwealthRain
            ENB_SetConfigFile_Interpolate("CommonwealthRain.ini", curTransition);
        else
            ENB_SetConfigFile_Interpolate("Default.ini", curTransition);
		endif

		StartTimer(0.02)
	EndIf
    
EndEvent

History version:
ENB script extender FO4 v2.zip
for F4SE 0.3.0+
(33.2 KiB) Downloaded 377 times
enb script extender FO4.zip
for F4SE 0.3.0
(28.7 KiB) Downloaded 391 times
Last edited by kingeric1992 on 05 Jan 2019, 12:54, edited 5 times in total.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [Skyrim/FO4] enb script extender

add FO4 version.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [Skyrim/FO4] enb script extender

update FO4 version with:

**profile saver
**function to interpolate to .ini
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*sensei*
Posts: 341
Joined: 27 Dec 2011, 21:33
Location: Poland, Gdańsk

Re: [Skyrim/FO4] enb script extender

That certainly looks amazing. Do you think it would be possible to create a HDR screen space motion blur shader by reading the mouse position or maybe camera rotation matrix and recreating velocity with it?
_________________
OS: Windows 10
CPU: AMD R5 3600
RAM: Corsair DDR4 16GB 3200MHz Vengeance
GPU: AMD Radeon 5700 XT
Sound Card: X-FI Titanium HD
Mobo: ASRock X370 Pro4
Monitor: M340CLZ 34" 3440x1440 100HZ AMD FREE Sync Curved Monitor

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17425
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: [Skyrim/FO4] enb script extender

Isn't it simpler to request such feature from me? :?
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
User avatar
*sensei*
Posts: 341
Joined: 27 Dec 2011, 21:33
Location: Poland, Gdańsk

Re: [Skyrim/FO4] enb script extender

Cue the many, many times when you refused doing motion blur because object based is buggy and screen based is in your opinion ugly :P

I mean, don't get me wrong, I would love official Motion Blur from you but I thought that you're totally not interested in that after the Skyrim failure.
_________________
OS: Windows 10
CPU: AMD R5 3600
RAM: Corsair DDR4 16GB 3200MHz Vengeance
GPU: AMD Radeon 5700 XT
Sound Card: X-FI Titanium HD
Mobo: ASRock X370 Pro4
Monitor: M340CLZ 34" 3440x1440 100HZ AMD FREE Sync Curved Monitor

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [Skyrim/FO4] enb script extender

ENBSeries wrote:Isn't it simpler to request such feature from me? :?
Not really... jk.

As for request, it would be nice if there is enbSet/GetParameter on texture objects, like retrieving/setting texture handles? if that's not too much of a non-sense.
And support for UI string in FO4 as always.

@MaxG3D
Wouldn't it look weird without per-object velocity?

FYI, you can achieve that with FO4 and SSE.
Use RenderTarget to store mouse pos from last frame.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*sensei*
Posts: 341
Joined: 27 Dec 2011, 21:33
Location: Poland, Gdańsk

Re: [Skyrim/FO4] enb script extender

kingeric1992 wrote: @MaxG3D
Wouldn't it look weird without per-object velocity?
I'm only asking for screen space motion blur, completely ignoring the object based. If you wouldn't mind writing such shader, that would be awesome, I'm not experienced in HLSL coding.
_________________
OS: Windows 10
CPU: AMD R5 3600
RAM: Corsair DDR4 16GB 3200MHz Vengeance
GPU: AMD Radeon 5700 XT
Sound Card: X-FI Titanium HD
Mobo: ASRock X370 Pro4
Monitor: M340CLZ 34" 3440x1440 100HZ AMD FREE Sync Curved Monitor

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [Skyrim/FO4] enb script extender

Just found out there are mod for Motion Blur on nexus. why not just go with it?

I've done some initial testing, and with shader alone, it will return false result when mouse hit the movement limit and get position reset.

So you either try to use the mod, or wait for boris's reply on if he's gonna implement that officially, if not, then I can do that through plugin.

also per-object motion blur is also a screenspace effect, with additional velocity map as input, and not just depth map.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*sensei*
Posts: 341
Joined: 27 Dec 2011, 21:33
Location: Poland, Gdańsk

Re: [Skyrim/FO4] enb script extender

kingeric1992 wrote:Just found out there are mod for Motion Blur on nexus. why not just go with it?
Vanilla game motion blur is:

A) Either LDR or simply ugly. I remember Boris commenting on it but I don't remember his exact words. It's just a cheap additive bullshit, not worth the time. It's definitely not like something you can see in Frostbite or Unreal Engine 4.
B) It's calculated only on the edges of the screen for some reason. There's no way to force it to be applied to the whole image.
_________________
OS: Windows 10
CPU: AMD R5 3600
RAM: Corsair DDR4 16GB 3200MHz Vengeance
GPU: AMD Radeon 5700 XT
Sound Card: X-FI Titanium HD
Mobo: ASRock X370 Pro4
Monitor: M340CLZ 34" 3440x1440 100HZ AMD FREE Sync Curved Monitor
Post Reply