Thank you for examples, txesmi! I have a question.
Code
float3 clipSpaceCoordinates = mul(float4(vecLightPos[i].xyz, 1.0f), matViewProj).xy;
float2 normalizedProjectionCoordinatesXY = clipSpaceCoordinates.xy / clipSpaceCoordinates.w;
clipSpaceCoordinates is a float3, but you use it's clipSpaceCoordinates .w in normalizedProjectionCoordinatesXY calculation.
Also, in clipSpaceCoordinates itself you only set .xy while calculating it.
So in order to compile, I've changed float3 clipSpaceCoordinates to float4, but it doesn't work.
Also, I've set CHILD flag for the pp view.

EDIT:
Also in
Code
normalizedScreenCoordinates.y = (1.0f - normalizedProjectionCoordinatesXY.y) / 4.0f;
You used
Code
normalizedProjectionCoordinatesXY.x
Instead of Y is that intentional?

EDIT2: ok, I see that you fixed the previous post, but it still doesn't work for some reason...
This is the code I tried out (tried both vecLightViewPos and vecLightPos).
Code
float4 clipSpaceCoordinates = mul(float4(vecLightViewPos[i].xyz, 1.0f), matViewProj);
float2 normalizedProjectionCoordinatesXY = clipSpaceCoordinates.xy / clipSpaceCoordinates.w;
float2 normalizedScreenCoordinates;
normalizedScreenCoordinates.x = (1.0f + normalizedProjectionCoordinatesXY.x) / 4.0f;
normalizedScreenCoordinates.y = (1.0f - normalizedProjectionCoordinatesXY.y) / 4.0f;
float2 screenCoordinates = normalizedScreenCoordinates * vecViewPort.xy;

float normalizedProjectionCoordinatesOfOuterPointOfLightSphereX = mul(float4(vecLightViewPos[i].xy, vecLightViewPos[i].z - vecLightViewPos[i].w, 1.0f), matProj).x;
float projectedLightRadiusInScreenPixels = vecViewPort.x * (normalizedProjectionCoordinatesOfOuterPointOfLightSphereX - normalizedProjectionCoordinatesXY.x) / 2.0f;

Last edited by 3run; 05/13/20 19:55.

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