|
I'm wondering, which algorithm is used for projectors. It seems that an arbitrary number of projectors is supported - even on mobile. Since I'm mainly developing for mobile platforms, I would like to know how the algorithm works to better understand how it would impact performance if used excessively. I've already done some research, and those are the approaches I have found so far:
Is Unity's algorithm one of those approaches or something completely different? UPDATE: I have added some screenshots from a simple scene which contains 1 terrain, and 33 projectors which are using 3 different projection-materials/textures. The scene without projectors:
The scene with projectors:
So, to me it looks like the geometry which receives the projections is rendered number-of-projectors times (in this case 33 times). Am I seeing this right? That could have a serious performance impact especially on mobile platforms, i guess.
(comments are locked)
|
|
All a "projector" is, is another rendering pass. You can do whatever you want with it, but Unity sets up some special variables for it: http://en.m.wikibooks.org/wiki/GLSL_Programming/Unity/Projectors Question, is it one extra pass per projector, or one extra pass for all projectors? Thanks (Sorry if this is incredibly lame question for you :) )
Sep 18 '12 at 08:02 PM
Fattie
It's not lame at all. I actually don't know how this is handled. I bet that when you use a projector, it breaks batching. I'd have to go check it out, too, so please let us know what the stats window tells you.
Sep 18 '12 at 08:12 PM
Jessy
I have added some screenshots to my question which include the stats window.
Sep 21 '12 at 01:52 PM
j00hi
The big thing to notice is draw calls. Compare your two screenshots. On one, there's 53 draw calls. On the other, 1752 draw calls. 53 x 33 = 1749, so you can see that the draw call count is a direct result of using that many projectors.
Sep 21 '12 at 04:33 PM
Screenhog
fantastic analysis screenhog, thanks for that!
Sep 21 '12 at 04:41 PM
Fattie
(comments are locked)
|
|
Projectors actually works similar to the way post-process works. It simply renders what ever geometry it's on its frustum and then project from that POV the texture in projector (it's camera) space. I'm not sure if it does the projection in the same pass (while rendering the depth information) or in a extra pass but what i know is they shouldn't be there, they are extremely heavy. It is possible to do deferred decals in forward rendering using a depth+normal texture (well at least i got some ideas how to do it). ^^
(comments are locked)
|



jewel FWIW. as a "rule of thumb" i've never been able to use more than "a few" projectors in a scene. I've always assumed everyone else found that to be the case. Say 5 tops to put a number on it. Dunno if that helps you.