So this is how I got it working so far (in motion it 'flickers')
[Linked Image]

.fx file (if anyone needs it):
Code
//source
//https://www.shadertoy.com/view/ttj3zd

float4x4 matViewProj;
const float4 vecTime;
const float4 vecViewPort;

float lightRangeFactor = 1.0;
float smoothObjectPadding = 0.33;
float lightSaturationFactor = 0.2;
float flickerSpeedFactor = 2;

float iLights;
float4 vecLightPos[8];
float4 vecLightDir[8];
float4 vecLightColor[8];

texture TargetMap;

sampler postTex = sampler_state
{
	texture = <TargetMap>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;  
	AddressU = Clamp;
	AddressV = Clamp;
};

float4 FP(float2 fragCoord: VPOS) : COLOR
{
	float2 uv = fragCoord.xy / vecViewPort.xy;
	float3 color = tex2D(postTex, uv).rgb;
	float3 blurColor = float3(0.0, 0.0, 0.0);
	
	float aspectRatio = vecViewPort.x / vecViewPort.y;
	
	float i = 0;
	for(i = 0; i < iLights; i += 1.0)
	{
		// pointlights only
		if(vecLightDir[i].x <= 0 && vecLightDir[i].y <= 0 && vecLightDir[i].z <= 0)
		{
			float4 clipSpacePos = mul(float4(vecLightPos[i].xyz, 1.0f), matViewProj);
			float3 ndcSpacePos = clipSpacePos.xyz / clipSpacePos.w;
			float2 windowSpacePos = float2(((ndcSpacePos.x + 1.0) / 2.0) * vecViewPort.x, ((1.0 - ndcSpacePos.y) / 2.0) * vecViewPort.y);
			
			float2 objectCenter = windowSpacePos.xy / vecViewPort.xy;
			
			float2 v = uv - objectCenter;
			v.x = v.x * aspectRatio;
			float flickerTime = sin(vecTime.w * flickerSpeedFactor);
			
			float min_size = (vecLightPos[i].w * lightRangeFactor / 2.0) / 100;
			float max_size = (vecLightPos[i].w * lightRangeFactor / 2.1) / 100;
			float size = lerp(min_size, max_size, flickerTime);
			
			float smoothSize = size * smoothObjectPadding;
			float circleMix = smoothstep(size, size - smoothSize, length(v));
			
			blurColor.rgb = lerp(blurColor.rgb, color.rgb + (vecLightColor[i].xyz * lightSaturationFactor), circleMix);
		}
	}
	
	float4 fragColor = float4(blurColor, 1.0);
	return fragColor;
}

technique
{
	pass one
	{
		PixelShader = compile ps_3_0 FP();
	}
}


The only thing left is, to change lightrange depending on the distance to the light source. If you guys have any ideas, please let me know.
Couldn't get this one to work properly...
Code
float2 normalizedProjectionCoordinatesXY = mul(float4(vecLightViewPos[i].xyz, 1.0f), matProj).xy;
float normalizedProjectionCoordinatesOfOuterPointOfLightSphereX = mul(float4(vecLightViewPos[i].xy, vecLightViewPos[i].z - vecLightViewPos[i].w, 1.0f), matProj).x ; // doing the same in world space would need far more computations
float projectedLightRadiusInScreenPixels = vecViewPort.x * (normalizedProjectionCoordinatesOfOuterPointOfLightSphereX - normalizedProjectionCoordinatesXY.x) / 2.0f;


Best regards!

Last edited by 3run; 05/13/20 21:53.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung