我有一个Unity 3D场景,其中有多个摄像头看着同一个对象(一个巨大的大脑网格,约100k tri),但从相同的角度来看并不必要。
在同一3D场景中,存在大量的球面图网格(从100到30000)。
在所有摄像机中,我必须显示带有部分绘图网格的大脑网格。
根据摄影机视图的不同,每个图可以具有不同的大小(网格滤镜和球形对撞机),不同的材质(不透明或透明),并且可以可见或不可见。球形碰撞器必须具有与网格相同的尺寸。
我为每个球面网格设置了一个共享的网格。他们的资料可以是我定义的几种共享资料之一。
Before rendering the scene, for each camera view in the OnPreCull function i have to define which plots are visibles and how they look.
This part can be very costly, i tried several things :
I don't kwnow if i can make an efficient culling system with all theses cameras looking at the same point...
I welcome any new ideas.
First issue:
Regarding your specific question with the four dots.
Simply set the renderer.enabled = false
, that's all there is to it.
Note however that as I mention in a comment, you would never try to "cull yourself" in Unity (unless I have misunderstood your description).
Second issue:
Regarding the small spheres. I suspect you have very many in the scene. You simply can't do that. In video games (the most difficult of all 3D engineering), you just do this with billboarding. It's how say "grass" is done in a scene. You can achieve this nicely with the particle system in Unity, or other techniques. An implementation is beyond the scope of this answer, but you will have to fully investigate billboarding. Simply it's a small flat image which always faces the camera in the render pass.
Issue 2B:
Note however that sphere colliders are wonderful, and you can use as many as you want. I'm sure this is obvious from base mathematical reasons. Side tip: often folks try to "write their own" thinking it will be faster. It's impossible to outwrite the 100? person-years of spatial culling scientific research in PhysX, and moreover they use the metal, the gpu, so you can't beat it.
Issue three:
Is there a chance you're using a mesh collider somewhere in the project? Never use mesh colliders, at all. (It's extremely confusing they are mentioned or used in Unity; they only have one or two very specific limited uses.)
Issue four:
I'm confused about why you are turning things on and off. I have a guess.
There's an amazing trick about video games when you have more than one camera. In fact you have "offscreen" scenes! So you may have players in a dungeon or the like. Off "to the side" you may have an entirely duplicate or triplicate setup of the whole thing running (you could "see it if the camera turned the wrong way") for the other cameras. (In the example you would have different qualities on the dopplegangers, coloring, map-style or whatever the case is.) Sometimes you make a whole double just to run physics calculations or address other problems.
Fascinating extreme example of that sort of thing.
In short in your situation,
同样,它可以是http://answers.unity3d.com/answers/299823/view.html,但这确实是日常工作。在您的整个场景中,您将看到八个并排坐着的快乐大脑,每个大脑都有自己的摄像头。在每个项目中,您将显示任何相关的项目/角度等。(显然,如果某些项目是“相同的,除了视角之外”,则可以使用“同一大脑并带有多个摄像头”:但是我不会这样做,最好为每个视图都配备一脑一摄像头)
我相信这可能是您遇到的基本问题!
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句