Page 1 of 1
Multiple passes in enbeffect.fx
Posted: 28 Jan 2014, 16:54
by prod80
Hello,
Anyone know if it's possible to have multiple passes in enbeffect.fx? pref. 4-5 passes to combine several effects into a final image?
eg.
color correction / tonemap in 1st pass,
gaussian blurH in 2nd pass (1st pass as input),
gaussian blurV in 3rd pass (2nd pass as input),
blend blurred and original image to final image using soft light effect (1st pass + 3rd pass as input) as 4th pass
apply noise/other after effects as 5th pass (4th pass as input)
of course one could do a hack job by running everything in 1 pass, but the code lenght would tripple and compution double ...
Re: Multiple passes in enbeffect.fx
Posted: 28 Jan 2014, 18:56
by Marty McFly
enbeffect cannot do that, but enbeffectprepass (GTA IV doesn't have it but Skyrim, FNV, GTASA) has multiple passes, same goes for effect.txt. But that blurred image mixed with original is nothing else enbbloom does, bloom texture is almost same like original image but blurred. what you want is done in most enbeffects, first tonemapping, after that (or before that) bloom = blurred image mixed with original one and then if people want it, noise. There's no reason to split tonemapping and noise in two passes but if you want it, use Boris' blur sharp shift effect.txt, it has noise and effect.txt comes after all other postprocessor shaders.
Re: Multiple passes in enbeffect.fx
Posted: 29 Jan 2014, 21:23
by prod80
effect.txt also struggles with it because after creating the blur there seems to be NO way to blend it with the original color it started with.
Or am I missing some way to store the color it started with into some variable for later use? I don't see a way... the Sampler simply changes to last pass. Cant use bloom either because the blending technique is different from bloom and bloom is applied too early for the effect to take place. I need it to take place AFTER tonemapping and color corrections in enbeffect, cant move bloom after that (gonna look weird)... and like I said, what I want to do has nothing to do with bloom other than both using a blurred image and original to do their stuff.
Kindly request someone to verify if effect.txt can store the original color before PostProcess or any kind of hackjob workaround :p only thing I can think of is render the scene to texture and use this texture again as input later on... don't think possible :\ having original available would open some interesting options in blending techniques.
Re: Multiple passes in enbeffect.fx
Posted: 30 Jan 2014, 11:55
by ENBSeries
All external shaders do not allow to store original color after some pass, render targets are flipped and previous destination used as current source and previous source and current destination. I don't know how to declare separated processing without any issues when user ask "what if...", don't see ideal solution for all cases. Even keeping first input texture is useless if it must be proceeded and that result then split and mixed with another.
Re: Multiple passes in enbeffect.fx
Posted: 30 Jan 2014, 12:18
by prod80
Ok, but can effect.txt be setup the same as bloom fx, technically possible? To use multiple samplers and combine the results in a final pass? When I look over bloom fx it appears to run multiple effects on the different samplers and combine the results in the final pass ( or that is how Oyama's bloom fx appears to be setup, perhaps I should check with him... )
But to be honest, I have little experience in multi pass effects to understand clearly how they work. Guides on internet appear largely useless when it comes to ENB.
What I want to do exactly is do a gaussian blur (requires 2 passes alrerady), and use a special blending technique to combine the results of the gaussian with the original.
One can think about blend modes like photoshop Soft Light, Overlay, Screen, Lighten, Darken, Multiply, and so on... not to mention other interesting things one can configure using those blend modes (eg only blend highlights, applying curves to the blending, applying noise and substract that to create a hazy bloom effect, etc)... one can have lots of fun with blending A & B.
Re: Multiple passes in enbeffect.fx
Posted: 30 Jan 2014, 16:36
by ENBSeries
Existing shaders can't do this, except bloom. And i wrote already, don't see solution to declare new standart without limiting something else. What if user ask to draw 7 passes to different surfaces and in last pass mix them all?
Re: Multiple passes in enbeffect.fx
Posted: 30 Jan 2014, 17:46
by prod80
Ok clear, not possible. I'll see if any other cool stuff can be done in single pass, but most is just contrast, intensity, etc... which is rather straight forward. Maybe I'll empty the bloom.fx and have some fun in there, or use _s3 for something funky besides bloom. Perhaps that will result in interesting things.
_s3 is not scaled in background by EBloomAmount, right? Only applied via enbeffect.fx *EBloomAmount
Re: Multiple passes in enbeffect.fx
Posted: 30 Jan 2014, 18:47
by ENBSeries
It's possible, but only if i'll get the idea how to declare new standart for all scenarios.
_s3 is not scaled, it's the same as output after enbbloom.fx, but the size of texture is 512*512 right now (i don't see much reason to make full screen size bloom if smaller sizes can be computed in enbeffect.fx, faster).
Re: Multiple passes in enbeffect.fx
Posted: 30 Jan 2014, 19:12
by prod80
cool, thanks Boris
I'll see if I can put _s3 in for some alternative uses besides bloom
Is there any documentation exactly what all the _s* and _c* are exactly? I know some (sorta) but not all
edit: nvm using _s3 to blend works, but results is a bit weird
Re: Multiple passes in enbeffect.fx
Posted: 31 Jan 2014, 00:30
by ENBSeries
Docs not exist, the data partially declared by me, partially from game shaders. Look at the end of enbeffect.fx, there is vanilla shader code and that's all information available.