Xorchan's Modular ENB Effect.txt Framework

general download section
  • Author
  • Message
Offline
User avatar
*blah-blah-blah maniac*
Posts: 849
Joined: 28 Dec 2011, 00:50

Re: Xorchan's Modular ENB Effect.txt Framework

Ah ok, so the following lines exist in both filmgrain.fxh and vignette.fxh (but not in fauxcell.fxh):

Code: Select all

VS_OUTPUT_POST VS_PostProcess(VS_INPUT_POST IN)
{
	VS_OUTPUT_POST OUT;

	float4 pos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);

	OUT.vpos=pos;
	OUT.txcoord.xy=IN.txcoord.xy;

	return OUT;
}

Can these be moved to a global file? Or what do you suggest?

I see that the common.fxh file already has the following at the end:

Code: Select all

VS_OUTPUT_POST VS_Passthrough(VS_INPUT_POST IN)
{
	VS_OUTPUT_POST OUT;
	OUT.vpos = float4(IN.pos, 1);
	OUT.txcoord = IN.txcoord;
	return OUT;
}
_________________
Fallout 4 ENB Video Series | Skyrim ENB Video Series | My YouTube Channel
Intel i7-4700HQ @ 2.4GHz | NVidia GTX780M 4GB | 24GB RAM

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

Re: Xorchan's Modular ENB Effect.txt Framework

VS_Passthrough is already used in all techniques, you don't need another vertex shader.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
*sensei*
Posts: 397
Joined: 16 Mar 2013, 16:28

Re: Xorchan's Modular ENB Effect.txt Framework

why don't you just move all the shaders into effect.txt and just #define - //#define them at the top to enable/disable them ?

you can #ifndef - #endif around the individual shaders code and comment the sections.

that way you have all the code in effect tekst from all shaders, just 1 file and only #include common.fxh and technique.fxh.

or doesn't that matter for the multipass ability ?
_________________
Intel I9-9900k, RTX 3070, 1TB Samsung EVO 970, 1TB Crucial SSD, 1TB Kingston SSD , Realtek HD Audio, 16GB 3400MHZ System RAM, W10 Pro x64.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 849
Joined: 28 Dec 2011, 00:50

Re: Xorchan's Modular ENB Effect.txt Framework

@Boris

Ok yay, it all works now :)


@Marcurios

Well, I am just trying to keep the effect.txt file as a simple configuration file while all the shader code is elsewhere. It may not be super useful, but it is helping me understand how things work ;)
_________________
Fallout 4 ENB Video Series | Skyrim ENB Video Series | My YouTube Channel
Intel i7-4700HQ @ 2.4GHz | NVidia GTX780M 4GB | 24GB RAM

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

Re: Xorchan's Modular ENB Effect.txt Framework

On my opinion it's good method to declare shaders, but bad to performance, because each technique rendering is not for free. Better most effects to group in single pass and use only multiple passes when really required, like blur with big radius or sharpening after some effect. I still can't decide how to declare everything because of such issues, seems simplicity and performance can't be together.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
*sensei*
Posts: 397
Joined: 16 Mar 2013, 16:28

Re: Xorchan's Modular ENB Effect.txt Framework

@Boris
that is actually what i ment, i thought if you put the code in one file it would be processed in one go,
but now i read your answer i think that it does not work this way.
because they are loose shader files they automatically do multiple passes, am i right ?
for it to work as single pass you would probably need to write all shader functions in one piece of code.
like one big function with parameters so you can enable/disable different effects within that single function.

i wanted to ask you another thing, we can configure DOF and all kinds of other features by external (text/script) shader files,
is this also the case for shadow configuration or is that hardcoded into the dll ?
or are there some parameters that can be controlled with an external file ?

@Tapioks
i have it like this, my effect.txt;

Code: Select all

#include "common.fxh"

// Enable just AA
#define USE_ANTI_ALIASING 1
#define FXAA_QUALITY__PRESET 6
float fxaaQualitySubpix = 0.3885;
float fxaaQualityEdgeThreshold = 0.1515;
float fxaaQualityEdgeThresholdMin = 0.0545;

#include "enbseries\fxaa2.fxh"

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Natural Colors
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// Chromatic adaptation: (makes all tones more neutral)
#define EADAPTATION

// The target white point (0-10, higher = more blue)
// If default is too blue, try 4, if it's too red, try 6
#define WHITEPOINT 5

// Saturation controls: (Uncomment the #define to enable them)
// 0 is grayscale, 1 is normal, higher values = more saturated
#define SATURATION 1.1

// Load the effect
#include "enbseries\naturalcolors.fxh"

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Sharpen
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// Default preset
#define ESHARPENING
#define ESHARPENINGCOLOR
#define ENOISE

#include "enbseries\sharpen.fxh"

#include "technique.fxh"
common.fxh and technique.fxh in root dir together with dll and effect.txt and shader files in enbseries dir.
Also took out the includes to common/technique.fxh files out of the shader files in the enbseries dir.
i thought it was the most elegant solution.

and like Boris said, you do not want to include those common and technique over and over again in each shader so i do that in effect.txt.
_________________
Intel I9-9900k, RTX 3070, 1TB Samsung EVO 970, 1TB Crucial SSD, 1TB Kingston SSD , Realtek HD Audio, 16GB 3400MHZ System RAM, W10 Pro x64.

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

Re: Xorchan's Modular ENB Effect.txt Framework

There are no hidden features or parameters, you can't modify anything which is not developed for users editing. And i don't want to make any editing available, because it broke all optimization and will limit me in any changes to the code, like the issues i'm having with current enbeffectprepass, enbeffect.fx and effect.txt files just because they are external.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
*sensei*
Posts: 397
Joined: 16 Mar 2013, 16:28

Re: Xorchan's Modular ENB Effect.txt Framework

OK, so are all basic functions that we can expand upon with code already in your enbeffect.fx and enbeffectprepass.fx files ?

what issues are you having by the way, are there big disadvantages from having external files ?
i can understand that if somone else writes some bad code in the external file that it can mess up performance,
but if i use your (written by you) external fx files, are there still limitations as supposed to just embedded code into the dll itself ?

i mean, does it matter if you write code into the dll or make a external file slot and write roughly the same code into that external file ?
i know it can never be exactly the same, but you know what i mean.
_________________
Intel I9-9900k, RTX 3070, 1TB Samsung EVO 970, 1TB Crucial SSD, 1TB Kingston SSD , Realtek HD Audio, 16GB 3400MHZ System RAM, W10 Pro x64.

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

Re: Xorchan's Modular ENB Effect.txt Framework

Everything is written in default shader files, no extra features, no parameters, nothing, it's standart.

When external files declared, i can't do any changes anyhow related to them, for example can't make different bloom algorithm, detach prepass shader from dof, can't place code of several shaders in single to increase performance, can't fix temporal antialiasing, can't make lenz reflections without changing standart of external shaders (incompability with existing presets).
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
User avatar
*blah-blah-blah maniac*
Posts: 530
Joined: 30 Jan 2012, 13:18

Re: Xorchan's Modular ENB Effect.txt Framework

You said you don't develop the old versions like for gtasa anymore so it should be no problem for you if you can't do that stuff with them.I'd like to see how the generic versions etc turn out when they have own enbeffect etc. What about moving all effects they do like ssao, dof, water etc into shaders so people can modify and maybe improve them?
Post Reply