mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Correct normal bias for entities
Remove use of magic constants. Apply cameraOffset Calculate distance projected on SM plane
This commit is contained in:
parent
25c1974e0d
commit
4801bdf45a
4 changed files with 14 additions and 15 deletions
|
@ -58,15 +58,13 @@ void DirectionalLight::createSplitMatrices(const Camera *cam)
|
|||
const v3f &viewUp = cam->getCameraNode()->getUpVector();
|
||||
v3f viewRight = look.crossProduct(viewUp);
|
||||
|
||||
v3f farCorner = look + viewRight * tanFovX + viewUp * tanFovY;
|
||||
v3f farCorner = (look + viewRight * tanFovX + viewUp * tanFovY).normalize();
|
||||
// Compute the frustumBoundingSphere radius
|
||||
v3f boundVec = (camPos + farCorner * sfFar) - newCenter;
|
||||
radius = boundVec.getLength() * 2.0f;
|
||||
radius = boundVec.getLength();
|
||||
// boundVec.getLength();
|
||||
float vvolume = radius * 2.0f;
|
||||
|
||||
float vvolume = radius;
|
||||
v3f frustumCenter = newCenter;
|
||||
// probar radius multipliacdor en funcion del I, a menor I mas multiplicador
|
||||
v3f eye_displacement = direction * vvolume;
|
||||
|
||||
// we must compute the viewmat with the position - the camera offset
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue