Search code examples
graphicsunity-game-enginefrustumculling

Disable culling on an object


This question is actually for Unity3D, but it can also be a more general question, so therefore I'm going to make this question as general possible.

Suppose I have a scene with a camera (near = 0.3, far = 1000, fov = 60) and I want to draw a skydome that is 10000 units in radius.

The object is not culled by the frustum of the camera, because I'm inside of the dome. But the vertices are culled by some shader somehow and the end-result looks like this:

My clipped skydome

Now my question is:

what setting for any engine can I change to make sure that the complete object is drawn and not clipped by the far plane of the camera?

What I don't want is:

  • Change the far plane to 10000, because it makes the frustum less accurate
  • Change the near plane, because my game is actually on a very low scale
  • Change the scale of the dome, because this setting looks very realistic

Solution

  • I do not know how to do this in Unity but in DirectX and in OpenGL you switch off the zbuffer (both checks and writing) and draw the skybox first.

    Then you switch on the zbuffer and draw the rest of the scene.

    My guess is that Unity can do all this for you.