lighting corrections:

1) fix spotlight shadow casting. we weren't properly accounting for reversedepthbuffer there
2) fix mismatched variables in forward lit spotlight param array
3) use disney diffuse in the generalized brdf, and apply it for spotlights after angular attenuation, not before
4) .provide a generailze luxTargMultiplier approach for spot and point lights (as well as future growth areas) so that range, angle ect can impact the brightness variable sent to a given light source shader without perpixel overhead
5) for spotlightParams in particular, use sizeof(point4f) for the alignedarray untill that's properly reviewed/revised
6) narrow attenuation slightly based on a given lights dot product to prevent tool vs outcome leakage, plus provide safeties for when a given spotslight's inner and outter angles match identially
This commit is contained in:
AzaezelX 2023-11-18 19:05:12 -06:00
parent 917cb882e9
commit 593d0ef9f0
9 changed files with 117 additions and 78 deletions

View file

@ -71,7 +71,8 @@ void SingleLightShadowMap::_render( RenderPassManager* renderPass,
lightMatrix.inverse();
GFX->setWorldMatrix(lightMatrix);
const MatrixF& lightProj = GFX->getProjectionMatrix();
MatrixF lightProj = GFX->getProjectionMatrix();
lightProj.reverseProjection();
mWorldToLightProj = lightProj * lightMatrix;
// Render the shadowmap!