Oblique Frustum for mirrors and skyboxes (Is not a question but some advice)

If you are like me, you probably have the standard method for a skybox, that is, draw a SxSxS cube around the camera.
Well, this method works pretty well, excepting if your are using Oblique frustum culling for mirrors.
This technic is great as you have clipping of objects between the mirror and the reflected viewpoint for free due the adjustment of the near clip plane to the reflecting surface.
It has a drawback too, that took me a few hours to discover, and of course when i realized about it it was so obvious… as always.

The simptoms: the skybox was not rendered in the mirror, even when everything else was ok.

The problem is: as you move away from the mirror the distance between the reflected viewpoint and the mirror increases, that is the near plane is further from the reflected viewpoint.

If that distance becomes greater than your S (remember: the dimension of your skybox) then the skybox will be clipped by the near plane and you won’t see it.

So here’s the advice: make your skybox bigger enough to don’t see this artifact, or, scale it by the maximum distance to the near plane if that distance is >= 1.0f.
You won’t suffer this artifact and you will have nice looking mirrors.

Hope this helps someone,

Toni