3D Engine architecture

Hi !
I’m working on my 3D engine, dedicated to a space game, and as I have lots of lightsources, I opted for a deferred way to display them.
My question concerns distant lights, ie: when they are close to the far plane. I dislike the way the lights disappear when between in view and out of view.
Would it be faster to handle a secund BoundingFrustrum, smaller than the camera’s, to handle the lights between the two. A sort of LOD for lights. And make them fade to pointsprites when getting far away from the camera like they did in Just Cause I think.

Isn’t an update of the secondary BoundingFrustrum too slow ? I never heard of games using more than the one use by the camera.

I have already elminated the solution of computing the distance for each light, even if I keep the squared version, even with a parallel method, as I think it would be too much overkill and dependend of the CPU’s core.

I’m not entirely sure i understand - the lights that are behind the far plane disappear - as they should, since they are rendered as spheres i suppose in your deferred renderer.

My question concerns distant lights, ie: when they are close to the far plane. I dislike the way the lights disappear when between in view and out of view.

That is the part i struggle with. How can you see the lights disappear at all? They are subject to the same farPlane like the rest of the models, right? The light itself can only be seen when there are meshes around that can be lit.
So how can the light “suddenly” disappear? If there is no mesh that can be lit behind the farPlane it’s impossible to see the light anyways, right?

Maybe make a quick paint drawing?

Sry If I appear too stupid :slight_smile:

Sorry I may not have been clear enough. :confused:

I use boundingsphere for pointlights to test their visibility as it is better than just testing with the center.
The problem with the far plane: it is visible as a truncated disk-shaped, as the sphere is not entirely clipped because it is accross the far plane.

As long as the boundingsphere is contained, it is ok, but if it intersects the boundingfrustrum, and in this case the farplane, it is visible on objects as an unlit disk-shaped zone (as a disk at the intersection of the sphere and the farplane, triangle outside the boundingfrustrum are cliped).
I’ll have to wait this evening when I’m off, to make a screenshot :confused:

If you go ahead and do this, note that MG does not support pointsprites (neither does XNA 4). Shawn Hargreaves blogged about why they deprecated it and how it doesn’t really hurt performance in most cases. Shawn Hargreaves Blog Index

About your issue, not sure I understand. Are you rendering a background image at the far plane or something? Or do you render the spheres around your lights?

Lights are spheres, rendered against the camera’s frustrum to check their visibility. The problem is when they intersect the farplane, it creates a hole in the sphere, seen as a disk shaped zone where this light is not rendered, ie: where the triangles are clipped by the farplane. How to force the spheres to not be clipped ? I only see a second boundingfrustrum with a closer farplane to check lights visibility for now.

When I said point sprites, in fact I was thinking of a billboard as a sprite light like in the old days, not really “the” pointsprite.