Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Steven-1 · May 06, 2012 at 10:13 AM · camerarenderz-buffer

Is there a way to render the area inbetween the camera and the near plane?

Basically I want to render everything close by, without a limit, as if the near plane is at 0 distance from the camera. I understand this could give problems for the z-buffer, but for all I care the area ibetween the camera and the near plane can be rendered without reading and writing the z-buffer. So is there any way to do this?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image eyal · May 06, 2012 at 10:24 AM 0
Share

I don't think so. By definition all object between camera and near plane are occluded. This is the reason for view frustum

avatar image Jacek_Wesolowski · May 06, 2012 at 10:43 AM 1
Share

By the way, what do you need this functionality for? Your saying that you don't need the z-buffer gives me the impression that you have some kind of 2D content to draw in front of a 3D scene - but that would be the job of an OnGUI() function.

avatar image Steven-1 · May 09, 2012 at 09:32 AM 0
Share

When you're on a planet, I render the planet-sphere with a different camera before the camera that renders the local scene (player, terrain, etc.), like a 3d skybox. Because of this I want the near plane distance for the space cam to be (nearly) 0, as the camera is nearly on the planet-sphere surface.

The only reason I can think of for the near plane limitation is for the z-buffer, so I thought if I only render the 1 planet, then I don't need the z-buffer, so I thought maybe it would be possible then.

1 Reply

· Add your reply
  • Sort: 
avatar image
3

Answer by Bunny83 · May 06, 2012 at 12:25 PM

No that's not possible for perspective cameras. A camera is infinitely small at it's origin. The 4 "rays" of the perspective projection meet at the origin. Each of these rays go through one of your screen corners. It's actually the space between your monitor and the virtual eye position (which is always behind the monitor). Also like you've mentioned when you use a very small nearplane the z-buffer accuracy is getting really bad.

An ortographic camera can have a negative nearplane since the "4 projection rays" are parallel.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Steven-1 · May 09, 2012 at 09:36 AM 0
Share

makes sense, I still don't get why there's the near plane limitation though, appart for z-buffer's sake. I mean I get that something at 0 distance from the camera would become infinitely big, but why is that a problem ?

well, anyway, it's not that big of an issue, I'll just try to do it some other way.

Thanks for the help.

avatar image Bunny83 · May 09, 2012 at 10:51 AM 0
Share

Well 0 distance means ultimatively your screens left coordinate and the the right coordinate are the same... "0". The near plane is your virtual screen. It's the actual "surface" on which everything is projected. It can be very small since we work with floating point values, but it can't be 0. See 3D projection (wikipedia).

The next problem arises when you use a very small near plane (~0.00001) you loose precision. See Accuracy Problems(wikipedia)

avatar image aldonaletto · May 09, 2012 at 11:14 AM 0
Share

When the near plane is set too near (< 0.1, for instance), far objects that intersect each other present ugly artifacts due to the Z-fighting - the boundaries flick crazily when the camera moves or rotates. A possible way to extend the depth buffer precision is to use two cameras, one with a near plane and a short far plane, and the other covering the area beyond this far plane. This is a limited solution, however, because big objects may be partially rendered by both cameras, still producing ugly artifacts at the near camera's far plane.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

gameObject.renderer.isVisible = false for one frame after activation 1 Answer

Let camera render the scene just one time 1 Answer

rendering things in order 0 Answers

Glow effect - alpha channel ignored to some specific android device 0 Answers

UI doesn`t render if camera is moved by 1000 units 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges