Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 tony oakden · May 17, 2010 at 11:28 PM · renderingobjectspvs

best way to render a list of objects

Hi everyone,

I've written a simple PVS (potential visibility set) system for a game I'm working on. It works fine but I'm concerned about efficiency so I'd like to run past you what I've done and see if there are better ways of doing it..

The way it works is pretty standard for a PVS...

1) The game world is divided into a 2D grid of cells

2) I have an offline tool which for each cell works out which objects in the scene are potentially visible (by ray casting many rays to evey object which takes quite a long time but because it's an offline tool it doesn't impact game play)

3) when the game runs it calculates which cell the player camera is currently in and thus knows which objects are visible and which are not.

4) Then what I do (and this is where I'm not sure about efficiency) is to disable all objects which are not visible and enable all objects which are). I only do this when the player changes cells.

The system works fine but I'm concerned that disabling and enabling the objects might not be the best way to do things. It seems to me that each PVS cell contains a list of all objects which I want to render so theoretically I could remove all objects which are in the PVS from the standard Unity rendering system and instead itterate through the PVS list rendering only those objects. I'm not sure this is possible though. Anyone know if it is or how best to do this? The game runs in a web browser so plug ins are not an option.

regards,

Tony Oakden

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by StephanK · May 18, 2010 at 07:43 AM

I don't know if what you are looking for is possible, but maybe it's easier to set all non-visible objects to a layer that is not rendered by the camera than constantly enabling/disabling them.

Comment
Add comment · 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
0

Answer by Ashkan_gc · Jun 01, 2010 at 08:51 AM

first of all i should say. unity 3 will have umbra as the scene management system. if you need to implement this now you should use layers. create a layer that camera don't render and then iterate through your list of objects and put those you don't want to render in that layer. setting layers is a fast binary operation but disabling and enabling them is a bit heavier. it involves many other lists like collision detection and many others. internals of the engine are not known for us but i think you can test layers and your current solution and see what get you higher FPS. for disabling you should disable just renderer component of those objects and not make them inactive. animations automatically will not run when the object will not be rendered so you don't need to wory about them.

Comment
Add comment · 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

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

No one has followed this question yet.

Related Questions

Terrain is transparent to objects 1 Answer

Objects surface look grey/foggy at distance 1 Answer

Rendering an object multiple times 3 Answers

Problem in camera while rendering some 3D objects..? 0 Answers

[Solved] Object Flickering When Camera Moves Around 6 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