http://www.opengl.org/discussion_boards/showthread.php/151023-scissor-region-from-bounding-sphere
code is for OpenGL and I'm working on Directx. Basically my adaptation is:
- Compute light pos in camera space and then negate Z component
- Compute aspect ratio = (screenW/screenH)
- Compute e (focal lenght) as 1/tan(FOV/2)
- Invoke Project_Sphere function
- Set scissor rect based on top function results (scaling them from [-1,1] to screen coords
results are ok If I'm "inside" the light volume or light is not visible: problem arises when intersection are computed.
Basically the returned rect is very small compared to results I'm expecting....any advice?