Near clip plane not behaving as expected

I would like to get closer to an object in the viewport, so I set the near clip plane to 0, assuming this meant I could get indefinitely close to an object. However, this didn’t seem to have an effect, and the most effective approach I could find was scaling up my mesh to look at it, then scaling it back down afterwards. Could someone please clarify what’s going on here?

Hi,

Near plane cannot simply have a value of 0 as its value is used in different places in the rendering pipeline. Setting it to 0 will result in division by zero in perspective transformation which will cause strange behaviors. See this beautiful short video by Eric Haines where he, as part of his free computer graphics course, briefly explains the purpose of the near and far planes.

To get the zoom behavior you want, simply get your camera component and call its function AddLocalOffset or AddWorldOffset to change its position and dolly back or forth (I would probably go with AddLocalOffset as the ‘X’ axis points forward, hence easier to manipulate).

Hope this helps.

Thanks. The video clarified things, but I’m asking about in-editor. I now suspect that the near clip plane value I modified in the settings was for the game, not the editor, which would explain why changing it didn’t resolve my issue.

I just tried to change the Near Clip Plane option in Project Settings. Turns out not only does it affect the game’s camera, but also the viewport’s camera! However, you will need to close and reopen the Editor for it to take effect. You can try a value of 2.0 instead of 10.0 which lets you dolly pretty close to your object without clipping through it! Try not to go too low with this value as it will adversely affect the z-buffer precision.

I see, thanks for clarifying! I closed and reopened the window I was in, but not the entire editor. Usually settings changes which require an editor restart alert the user, and I would suggest the development team add an alert here.