Add a lens flare

share shaders here
Post Reply
  • Author
  • Message
Offline
Posts: 19
Joined: 06 Jan 2013, 12:01

Add a lens flare

I am making my custom, private enb, but i would like to know how to add lens flares.
I used the god rays only enb on skyrim nexus as a start, but i enable bloom and adjusted the camerafx in enbseries.ini, but i still have no lens flares...
Any way to enable this? (not the sunsprite lens flares)

Offline
User avatar
*sensei*
Posts: 420
Joined: 10 Jun 2012, 12:31
Location: Sweden

Re: Add a lens flare

Be sure this is in your enbbloom.fx.

Code: Select all

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
	if (LenzParameters.x > 0.00001)    //If this is modified like 10.00001 lenz wont show up
	{
		for (int i = 0; i < 4; i++)
		{
			float2 distfact = (In.txcoord0.xy - 0.5);
			lenzuv.xy = offset[i].x * distfact;
			lenzuv.xy *= pow(2.0 * length(float2(distfact.x * ScreenSize.z, distfact.y)), offset[i].y);
			lenzuv.xy *= offset[i].z;
			lenzuv.xy = 0.5 - lenzuv.xy;
			
			float3 templenz = tex2D(SamplerBloom2, lenzuv.xy);
			templenz = templenz * factors[i];
			distfact = (lenzuv.xy-0.5);
			distfact *= 2.0;
			templenz *= saturate(1.0 - dot(distfact, distfact));//limit by uv 0..1
			
			float maxlenz = max(templenz.x, max(templenz.y, templenz.z));
			float tempnor = (maxlenz / (1.0 + maxlenz));
			tempnor = pow(tempnor, LenzParameters.y);
			templenz.xyz *= tempnor;
			
			lenz += templenz;
		}
		lenz.xyz *= 0.25 * LenzParameters.x;

		bloom.xyz += lenz.xyz;
		bloom.w = max(lenz.xyz, max(lenz.y, lenz.z));
	}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
	return bloom;
}
_________________
| i5 | 8gb RAM | GTX660 | Windows 8 | Skyrim on SSD |
My music project, Akira Project, website at Sound Cloud

Post Reply