show something outside of frustum

Hi.
I finally found a solution for a z_figthing problem that I have.
Since that append when my camera got very far from the element, I recalculate the near/far with the bounds of my scene.

That’s work wonderfully.
But I have now an another problem.
The skysphere I used As a background is not clipped by the near plane.

my sky_sphere:

sky.reparentTo(base.camera)
    sky.setTag('type', 'sky')
    sky.setPos(0,0,-50)
    sky.setEffect(CompassEffect.make(render))
    sky.setBin('background', 0)
    sky.setDepthTest(False)
    sky.setDepthWrite(False)

any idea will be welcome. but I think the best solution will be a renderAttrib(‘be rendered before the frustum clipping ?’ )

I don’t think I understand. Everything in the scene is clipped by the near plane and the far plane; you can’t turn that off. (You can move the near plane arbitrarily close to zero, and you can move the far plane arbitrarily close to infinity, but you can’t disable them altogether.)

The near and far plane exist because of the way the graphics hardware transforms 3-d vertices to 2-d for your screen. There’s no possibility for drawing things without clipping.

So, I don’t understand your problem. You say “The skysphere I used As a background is not clipped by the near plane.” Is this a statement of the problem, or a description of what you want to happen? If it is a statement of the problem, I have to say, you must be mistaken, because everything is clipped by the near plane. If it is a description of what you want to happen, I have to say sorry, that’s not possible.

But if what you want is to avoid your skysphere being clipped by the far plane, this is usually done simply by making the skysphere smaller. With all the attributes you have on it, it doesn’t really matter how big it is anyway; it will always be drawn outside everything in your scene, regardless of its size. So give it a radius of just 100 feet (or whatever) and it will still look like it’s filling the universe.

David

well.
I used to have a relatively small sky sphere, centered on the camera, drawn before as a ‘background’ bin and not writing on the z-buffer. that way, it was always on the background.

But now that I adjust the near plane when I’m far from y scene, the sky sphere is closer than the near plane and is clipped.
So I’m out of background. :stuck_out_tongue:

I have follow your advice and put a very big scale on the sky sphere so that it’s still inside the frustum

It’s works. I should have think of it myself
thank as always