Page 1 of 2
[REQ]Lens shader to bloom glow shader
Posted: 03 Sep 2012, 16:15
by MaxG3D
Is it possible to rewrite Boris Lens shader to a glow shader? So there wouldn't be any distortion, just bright halo around the bright spot. I only manage to remove color tint from it, so it's not pink anymore, it picks the color from the source of lens (You can check it out in my config, enbbloom.fx). I think it would be more useful and realistic, many new games have somthink like that.
Re: [REQ]Lens shader to bloom glow shader
Posted: 03 Sep 2012, 17:09
by ENBSeries
Example photo required.
Re: [REQ]Lens shader to bloom glow shader
Posted: 03 Sep 2012, 17:48
by MaxG3D
I would like to simulate an effect of looking at surface that reflects very bright light (like sun on very sunny day). Somthing like bloom, but not as wide, aplied only to very bright specular. That's why I thought lens shader would be perfect. Without pink tint and distortion it would do the job. These are not the best examples, but You should know what I mean:
Re: [REQ]Lens shader to bloom glow shader
Posted: 03 Sep 2012, 23:41
by icelaglace
Uhhh...
You can achieve that with ENB bloom you know...?
Re: [REQ]Lens shader to bloom glow shader
Posted: 04 Sep 2012, 00:07
by MaxG3D
icelaglace wrote:Uhhh...
You can achieve that with ENB bloom you know...?
Not at all, bloom is different, it affects whole screen, while lens (when properly set) affect only very bright spots. Besides, it already looks good, all I need is color tint and distortion removal. The ending effect would be the same like You would now point the crosshair exacly at the light source spot.
I hope that I explained that well.
Re: [REQ]Lens shader to bloom glow shader
Posted: 04 Sep 2012, 01:07
by ENBSeries
It's just a bloom. Make source of light more intense or make bloom more contrast before output in final pass of it's shader, before lenz fx computed. Actually lenz image source have contrast applied the same way to achieve more correct look for Deus Ex 3 game, which do not have proper hdr intensities, that's why i did that math for lenz.
This code in enbbloom.fx is applying contrast to lenz (LenzParameters.y value as contrast):
Code: Select all
float maxlenz=max(templenz.x, max(templenz.y, templenz.z));
float tempnor=(maxlenz/(1.0+maxlenz));
tempnor=pow(tempnor, LenzParameters.y);
templenz.xyz*=tempnor;
Insert after bloom*=0.142857; in shader PS_BloomPostPass this:
Code: Select all
float TBloomContrast=2.0;//tweak this
float maxb=max(bloom.x, max(bloom.y, bloom.z));
float tempnorb=(maxb/(1.0+maxb));
tempnorb=pow(tempnorb, TBloomContrast);
bloom.xyz*=tempnorb;
Hope didn't any typo mistakes.
Re: [REQ]Lens shader to bloom glow shader
Posted: 04 Sep 2012, 09:25
by MaxG3D
I thought You will modifie these:
Code: Select all
//deepness, curvature, inverse size
const float3 offset[4]=
{
float3(1.6, 4.0, 1.0),
float3(0.7, 0.25, 2.0),
float3(0.3, 1.5, 0.5),
float3(-0.5, 1.0, 1.0)
};
//color filter per reflection
const float3 factors[4]=
{
float3(1.0, 1.0, 1.0),
float3(1.0, 1.0, 1.0),
float3(1.0, 1.0, 1.0),
float3(1.0, 1.0, 1.0)
};
That way I removed color tint, but I wasn't sure how to modify the distortion code. Anyway, I apllied Your code into enbbloom but I have to redownload Skyrim so I will reply in couple of hours.
Re: [REQ]Lens shader to bloom glow shader
Posted: 04 Sep 2012, 12:12
by MaxG3D
Ok, it works and it's pretty awesome. Thank You very much Boris. I'm just having troubles tweaking it properly, it's hard to balance it to make it look realistic but not blinding (I have direct lighting set to 5, so it's quite high). Also, I don't know is it a bug or what but even thought I edited Lens shader to don't have pink/blue tint, it still does. But that's minor problem, not a big deal. I'll upload some screenshots when I finish tweaking my config for it. Once again, thanks a bunch Boris, You are awesome.
EDIT:
float TBloomContrast=2.0;//tweak this - doesn't seems to do anything.
Re: [REQ]Lens shader to bloom glow shader
Posted: 04 Sep 2012, 15:17
by ENBSeries
TBloomContrast - it is contrast for bloom, values must be between 1.0 and 6.0 for your needs, it must work, may be you just don't see this.
Re: [REQ]Lens shader to bloom glow shader
Posted: 04 Sep 2012, 15:23
by MaxG3D
ENBSeries wrote:TBloomContrast - it is contrast for bloom, values must be between 1.0 and 6.0 for your needs, it must work, may be you just don't see this.
Might be.
Hopefuly I managed to tweak it with normal bloom values. You can check the final effect in my config topic or in Skyrim gallery topic.