Converting SweetFX Effects To ENB

share shaders here
  • Author
  • Message
Offline
User avatar
*sensei*
Posts: 316
Joined: 12 Aug 2013, 18:55
Location: Scotland

Re: Converting SweetFX Effects To ENB

--JawZ-- wrote:Why is MSL so counter-intuitive?
Each effect has it's own file, so there won't be any misleading on what parts are associated with a particular effect. Apart from certain helper functions located in the msHelpers.fxh file. It's a easy copy & paste to any given .fx file from the get go.
So it is doing what you say, "supplying snippets of shader code, to be integrated with the .fx files".

It's better than having one file with 4933 lines of code in a row (That's just the enbeffect.fx related effect codes), quite messy to go through. If you doubt me go look in Oyama's shader files and see if the "all-snippets-in-one-file" really is a good idea.
Don't you have to define texture samplers and ENB-specific variables for each of the separate .fx file snippets? That can't be good for performance, and ya have to fuddle with organizing the list of the #includes after having added your code.

Simpler to just compartmentalize the main .fx file using comments.
_________________
Intel i7 6700k | AMD Vega 56 8GB | 2x16GB DDR4 @ 3000mhz | Windows 7 64bit | Creative Soundblaster X-Fi Titanium Fatal1ty Pro | Asus z170 Pro Gaming

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1938
Joined: 05 Mar 2012, 02:08

Re: Converting SweetFX Effects To ENB

It's fetched from the "main" file any of the .fxh file is included in.

Still having it all in one file is overwhelmingly much, especially for a new users.
I'm not saying you personally should stick to that default layout, it was never intended to be used as is, but to be merged.
However with the way I have it now, it will make it easier to just enable two code lines for effect activation, to see which effects will be the ones to make the cut. And when that is done import the codes into the main file. It's a simple copy paste from the .fxh files into the .fx files.

Offline
User avatar
*sensei*
Posts: 316
Joined: 12 Aug 2013, 18:55
Location: Scotland

Re: Converting SweetFX Effects To ENB

--JawZ-- wrote:It's fetched from the "main" file any of the .fxh file is included in.

Still having it all in one file is overwhelmingly much, especially for a new users.
I'm not saying you personally should stick to that default layout, it was never intended to be used as is, but to be merged.
However with the way I have it now, it will make it easier to just enable two code lines for effect activation, to see which effects will be the ones to make the cut. And when that is done import the codes into the main file. It's a simple copy paste from the .fxh files into the .fx files.
Eh. Suit yerself, but I'm sticking to me ol' Monolithic shaders. A bit of smart commenting goes a long way for organization; just add "//begin SomeEffect" at the beginning of a particular bit of shader code, then add "//end SomeEffect" at the end of it. Do the same for the GUI variables, and voila. Ctrl+F Heaven.



On a different note lads, I figured out how you add interior and night-day controls. Fairly simple, once you get your head around the whole lerp business. I'll share it fer posterity.

For example, let's take this bit of code.

Code: Select all

color=lerp(tempgray, color, ECCSaturation);
Lerp interpolates the first variable and the second variable, by using the third variable.

If the 3rd is @ 1, variable 1 is used at 100%.
If the 3rd is @ 0.5, variable 1 is at 50% and variable 2 is at 50%.
If the 3rd is @ 0, variable 2 is used @ 100%

So if we want to add interior-exterior separation, we just add an interior GUI control, and make the code into a nested lerp.

Code: Select all

color=lerp(tempgray, color, lerp(ECCSaturation, ECCSaturationInterior, EInteriorFactor));
Same idea for adding day-night separation. But if you want to add interior, exterior & night and day, ya will want to split it up.

Code: Select all

ECCSaturation=lerp(ECCSaturation, ECCSaturationNight, ENightDayFactor);

color=lerp(tempgray, color, lerp(ECCSaturation, ECCSaturationInt, EInteriorFactor));
_________________
Intel i7 6700k | AMD Vega 56 8GB | 2x16GB DDR4 @ 3000mhz | Windows 7 64bit | Creative Soundblaster X-Fi Titanium Fatal1ty Pro | Asus z170 Pro Gaming

Offline
User avatar
Posts: 44
Joined: 03 Apr 2014, 20:38
Location: United States

Re: Converting SweetFX Effects To ENB

FiftyTifty

I just wanted to express my thanks for this. It's just what I needed to get the game looking exactly how I wanted it with the limited options we already have with Fallout 4 ENB (which is understandable right now).

While I understand what JawZ is doing is great for newer users, I personally prefer all-in-one shaders because that's what I'm used to/have been working with since the ENB v119 days.

Out of curiosity, is it at all possible to add any GEM FX such as ambient light + those neat little lens dirt effects? I don't know much about what IS possible here honestly. I'm just a scrub who changes numbers and pretty things happen. Dithering would be nice to have as well since even with ENB's built in dithering/some noise, I'm still seeing color banding in the sky. I know it's due to a bad nif most likely but haven't seen a JawZ equivalent like the excellent one he made for skyrim.

Thanks again, really enjoying this!

Edit: just realized Reshade has been overhauled since I last downloaded. It is now called AmbientLight.fx in the Shaders/Ganossa folder.
_________________
i7 4790K @ 4.5 Ghz | EVGA GTX 1080 8GB SC ACX 3.0 | Corsair Vengeance Pro 16GB | Gigabyte GA-Z97X Gaming 5 | Cooler Master Nepton 240M | 750W 80+ Gold | Win 10

Tetrachromatic ENB
http://www.youtube.com/slothability

Offline
User avatar
*sensei*
Posts: 316
Joined: 12 Aug 2013, 18:55
Location: Scotland

Re: Converting SweetFX Effects To ENB

That's more of a question for Boris, or lads more acquainted with ENB.

The AmbientLight effect defines custom textures, and I dinnae know if we can do that just by editing the enbeffect.fx file. And I don't know how multipasses work either, so I'm not any help in that regard.

Once those two bits are figured out, the rest is just changing variables and porting them to ENB (defining GUI variables, replacing the shader code variables to accommodate), which is the easy part.
_________________
Intel i7 6700k | AMD Vega 56 8GB | 2x16GB DDR4 @ 3000mhz | Windows 7 64bit | Creative Soundblaster X-Fi Titanium Fatal1ty Pro | Asus z170 Pro Gaming

Offline
User avatar
Posts: 44
Joined: 03 Apr 2014, 20:38
Location: United States

Re: Converting SweetFX Effects To ENB

Ah, okay, no worries!

Out of curiosity, in your previous post you had mentioned you figured out DNI separation. Does that mean you plan to apply DNI spearation with the effects you've ported here or were just mentioned that for general use?

If that's how it works for other effects/enbeffect files in general, that's very useful to me either way and I may be able to do it myself for some older shader files I like to use.
_________________
i7 4790K @ 4.5 Ghz | EVGA GTX 1080 8GB SC ACX 3.0 | Corsair Vengeance Pro 16GB | Gigabyte GA-Z97X Gaming 5 | Cooler Master Nepton 240M | 750W 80+ Gold | Win 10

Tetrachromatic ENB
http://www.youtube.com/slothability

Offline
User avatar
*sensei*
Posts: 316
Joined: 12 Aug 2013, 18:55
Location: Scotland

Re: Converting SweetFX Effects To ENB

Slothability wrote:Ah, okay, no worries!

Out of curiosity, in your previous post you had mentioned you figured out DNI separation. Does that mean you plan to apply DNI spearation with the effects you've ported here or were just mentioned that for general use?

If that's how it works for other effects/enbeffect files in general, that's very useful to me either way and I may be able to do it myself for some older shader files I like to use.
ENB isn't compatible with the latest Fallout 4 versions, nor is Fallout 4 a fun game; the novelty wore off fairly quick, so I won't be adding Day/Night/Interior controls to the shaders.

But yeah, it's pretty simple. Typically, you make the shader code affect the screen directly by modifying the "color" variable. Instead, make your own variable, cast it to color (float3 MyColorVar = color.xyz;), then just change the shader code to accommodate that (search-replace color with MyColorVar).

Finally, you use the lerp function. It works like so:

Code: Select all

lerp(color, ColorChangedByShaderCode, BlendingVariable);
_________________
Intel i7 6700k | AMD Vega 56 8GB | 2x16GB DDR4 @ 3000mhz | Windows 7 64bit | Creative Soundblaster X-Fi Titanium Fatal1ty Pro | Asus z170 Pro Gaming

Offline
User avatar
Posts: 44
Joined: 03 Apr 2014, 20:38
Location: United States

Re: Converting SweetFX Effects To ENB

ah, haven't had any issues myself using the latest version but I understand.

I think it's a bad fallout game but fun to just wander and mod when bored. ENB is just a way to kill time and I find that much more enjoyable. I suppose I still have the "novelty" of working with ENB again in a totally different setting if that makes sense.

Thanks for the tips on DNI, I'll try to add it myself and dissect other shaders to make sure I'm doing it right. Once again, thanks for the work/time you put into this, really enjoying it :).
_________________
i7 4790K @ 4.5 Ghz | EVGA GTX 1080 8GB SC ACX 3.0 | Corsair Vengeance Pro 16GB | Gigabyte GA-Z97X Gaming 5 | Cooler Master Nepton 240M | 750W 80+ Gold | Win 10

Tetrachromatic ENB
http://www.youtube.com/slothability

Offline
Posts: 66
Joined: 20 May 2012, 13:34

Re: Converting SweetFX Effects To ENB

i got smaa error when load a game
Post Reply