• 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
Question by Bytestorm83 · May 15, 2018 at 12:41 PM · camerasclipping plane

Orthographic Camera with an angled Near Clipping Plane?

I am designing an Isometric BaseBuilding game using Voxels (Block style) and the Orthographic camera, nested into a Camera Target that itself will be moved on the x,y,z. I have all the building of the world done, but a problem I have is I intend to 'slice' the levels at each y level. I think this can be done one of two ways.

  1. In each "block" render, disable the meshes above the y-level of the Camera Target, which means I need to ensure that all pathfinding and jobs function in the unrendered areas. I also need to redraw the level immediately above the Camera Target, and I am unsure of the performance impact of that if I were to quickly traverse levels.

  2. Set the Near Clipping Plane to "flatten" on the y level, which cuts off the camera view of anything above the Camera Target, keeping everything rendered and unchanged.


I'd like to solve this before I get too far in designing everything else, so I at least have a foundation for my rendering method that I can carry through the rest of the program. Thoughts?

Comment

People who like this

0 Show 4
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 Glurth · May 15, 2018 at 05:19 PM 0
Share

Not quite certain if I understand, you want to NOT draw any blocks that are above a specific height (the height of the current level)?
My initial thought would be to do this with a shader that ignores or outputs a transparent pixel, for every point with a height (in view-space, not world-space) over a particular value.

avatar image Bytestorm83 · May 15, 2018 at 06:00 PM 0
Share

Yes, that is what I am trying to do.

I am looking, honestly, for the most efficient way to do things. Would it be more efficient to use another check for shader rendering based on the height of my Camera Target, or would just letting the camera "cut-off" on the near plane be more efficient?

Since I am using a Camera Target (empty GameObject) as the measurement (anything above it, is to be transparent), and that will be the focal point of the Camera itself, I will be functioning off of World Space instead of the viewport.

avatar image Glurth Bytestorm83 · May 15, 2018 at 06:44 PM 0
Share

I'm not sure which way would be more efficient, the shader or the clipping, I'd guess it depends on the implementation.
To achieve your goal of NOT rendering these objects (clipping), you can disable the block's MeshRenderer component. This will not affect physics or anything else, just whether or not it sends the mesh to the render pipeline. Note: This would require EITHER:
-that ALL blocks have a reference to the camera, in order to compare their height to it, and appropriately enable/disable the MeshRenderer Component (probably in Update()).
OR
-that you have a function that will go through your blocks and turn the MeshRenderer component on/off, whenever you move the camera up/down.

avatar image Bytestorm83 Glurth · May 15, 2018 at 06:56 PM 0
Share

Fair enough, I can envision how that would work. I'll give that a shot tonight. Thanks!

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

82 People are following this question.

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

Related Questions

Objects disappear when camera gets closer 1 Answer

Multiple cameras assigned different depths 2 Answers

spawning position problem 0 Answers

Rendering different cameras with the same depth? 1 Answer

Unity 2D Make An Object Disappear On Click 0 Answers


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