[FO4] Flares enblens.fx

share shaders here
  • Author
  • Message
Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: [FO4] Flares enblens.fx

Copy that.
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: [FO4] Flares enblens.fx

Working perfect, but impossible to have original lens effect mixing with yours.
I might screw something, or I don't get where to add 'color+=...', etc.
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [FO4] Flares enblens.fx

What it is you wished to achieve with the default ENB lens shader?
I know it's 1d blur, but is it preferred to be slim lines or fat lines?

And here is the initial test of bloom masked by lens alpha.
Image
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: [FO4] Flares enblens.fx

Wow... Nice.

@Original lens shader : on Skyrim SE, I'm doing anamorphic dirt with it, like you did with starburst. The dirt effect lies only in anamorphic flare. Looks quite nice. I wouldn't want to lose it.
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

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

Re: [FO4] Flares enblens.fx

So it also works on SSE? Good, then I can test it :p

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: [FO4] Flares enblens.fx

Marty McFly wrote:So it also works on SSE? Good, then I can test it :p
It does.
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [FO4] Flares enblens.fx

Oyama
On second thought, it is better to leave enb default for last so that it didn't overwrite bloom in RenderTarget## (or is it already cleared? ) and no additional RenderTargetRGBA64F required.

change the end of the technique section like this.

Code: Select all

technique11 Lens6
{
    pass p0
    {
        SetVertexShader(CompileShader(vs_5_0, VS_LENS_Mix()));
        SetPixelShader( CompileShader(ps_5_0, PS_LENS_Mix()));
    }
}

technique11 Lens7 < string RenderTarget="RenderTarget512";>
{
	pass p0
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_Resize(TextureDownsampled, 1024.0, 512.0)));
	}
}

technique11 Lens8 <string RenderTarget="RenderTarget256";>
{
	pass p0
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_ComputeLens1(RenderTarget512, 512.0)));
	}
}

technique11 Lens9 <string RenderTarget="RenderTarget512";>
{
	pass p0
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_ComputeLens2(RenderTarget256, 256.0)));
	}
}

//in last pass output to lens texture of screen size
technique11 Lens10
{
	pass p0
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_LensMix()));
	}
}
and add those corresponding shaders and functions before it, with a only modification in PS_LensMix

Code: Select all

float4	PS_LensMix(VS_OUTPUT_POST IN, float4 v0 : SV_Position0) : SV_Target
{
	float4	res;
	float4	color;
    float4  flare;

	color=RenderTarget512.Sample(Sampler1, IN.txcoord0.xy);
    flare=TextureColor.Sample(Sampler1, IN.txcoord0.xy * 0.5);
    
	float3	colorfilter=EColorFilter;
	float	intensity=dot(color.xyz, colorfilter);
	intensity=pow(intensity, EContrast);

	res.xyz=intensity * EColorFilter + flare.rgb;

	res=max(res, 0.0);
	res=min(res, 16384.0);

	res.w=1.0;
	return res;
}
I was asking on the usage of that because there is still a unused halfres slot in my process and it could be a benefit over the original 512&256 size, and save up the techniques in the same time.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: [FO4] Flares enblens.fx

Nice ! Thank you ! :)
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: [FO4] Flares enblens.fx

Using it on Skyrim SE, and using the Skyrim Mod version of lens techniques, impossible to have both running. Even with your suggested modifications.

Original PS shader :

Code: Select all

float4	PS_MixSkyrimLens(VS_OUTPUT_POST IN, float4 v0 : SV_Position0) : SV_Target
{
	float4	res;
	float4	color;
	float2 coord = IN.txcoord0.xy;	
	res=RenderTarget512.Sample(Sampler1, IN.txcoord0.xy);
	res=max(res, 0.0);
	res=min(res, 16384.0);
	res.w=1.0;
	return res;
}

Original techniques : (in which I added a P1 pass to draw dirt texture in anamorphic frame only, via a separated shader, but it can't be the issue I think)

Code: Select all

// Version from Skyrim mod
technique11 SkyrimLens <string UIName="Skyrim mod lens"; string RenderTarget="RenderTarget512";>
{
	pass p0
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_Resize(TextureDownsampled, 1024.0, 512.0)));
	}
	
	#if (useDirtALF == 1) 
	pass p1
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_DrawDirtAnamorphicLens()));
	}
	#endif
	
}

technique11 SkyrimLens1 <string RenderTarget="RenderTarget256";>
{
	pass p0
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget512, 512.0, 256.0)));
	}
}

technique11 SkyrimLens2 <string RenderTarget="RenderTarget128";>
{
	pass p0
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget256, 256.0, 128.0)));
	}
}

technique11 SkyrimLens3 <string RenderTarget="RenderTarget512";>
{
	pass p0
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_DrawSkyrimLens(RenderTarget256, 256.0, 512.0)));
	}
}

technique11 SkyrimLens4
{
	pass p0
	{
		SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
		SetPixelShader(CompileShader(ps_5_0, PS_MixSkyrimLens()));
	}
}
BTW, what was your idea to have both running in parallel ?...
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [FO4] Flares enblens.fx

I thought you meant the "Multipass Lens", anyway, here is the file that integrate the oldrim lens.
I've add a option "useBloomTex" which will bypass the blur process and straight up using the result from bloom pass. (making it dependent to the bloom effect in the mean time)
Tested good in FO4. (I didn't add the alf shader)
enblens.fx
Oldrim Lens Addon
(24.73 KiB) Downloaded 164 times
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube
Post Reply