•      Sign In
• Create Account

Need scary sound effects or creepy audio loops for your next horror-themed game? Check out Highscore Vol.3 - The Horror Edition in our marketplace. 50 sounds and 10 loops for only \$9.99!

### #Actualcsisy

Posted 30 June 2012 - 12:23 PM

I render the shadowmap to the screen, and it looks like the sphereBounds was too "small". And I find the problem, I was stupid
When I computed the sphere's center, I get the radius from the d(center, corners[0]), which is the near-left-bottom corner of the frustum. The correct is the d(corners[0], corners[6]), where the 6th corner is the far-right-top corner.

sphereBounds = Vector3::Distance(frustumCorners[0], frustumCorners[6]);
sphereRadius = sphereBounds * 0.5f;


Now, it works really good. Thanks for your help, the topic is solved (for me).

Ps.:
Can I set the topic to solved state, or set your post as a solution?

EDIT:
I have to use another little hardcoded thing:
sphereBounds = Vector3::Distance(frustumCorners[0], frustumCorners[6]) + 5.0f;

because the camera sees the scene from top, and the sphereBounds wasn't big enough.

### #1csisy

Posted 30 June 2012 - 12:12 PM

I render the shadowmap to the screen, and it looks like the sphereBounds were too "small". And I find the problem, I was stupid
When I computed the sphere's center, I get the radius from the d(center, corners[0]), which is the near-left-bottom corner of the frustum. The correct is the d(corners[0], corners[6]), where the 6th corner is the far-right-top corner.

sphereBounds = Vector3::Distance(frustumCorners[0], frustumCorners[6]);
sphereRadius = sphereBounds * 0.5f;


Now, it works really good. Thanks for your help, the topic is solved (for me).

Ps.:
Can I set the topic to solved state, or set your post as a solution?

PARTNERS