x


What is the algorithm used behind projectors?

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:

  1. use a deferred renderer and the g-buffer (I guess that wouldn't work on mobile?)

  2. create a tri-overlay and use alpha-blending

  3. combine texture with projcted texture - precalculate the texture (in every frame)

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:

Scene with projectors

The scene with projectors:

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.

more ▼

asked Sep 18, 2012 at 06:54 PM

avatar image

j00hi
16 2 3 5

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.

Sep 21, 2012 at 01:55 PM Fattie
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

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

more ▼

answered Sep 18, 2012 at 07:39 PM

avatar image

Jessy
18.5k 209 184 310

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, 2012 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, 2012 at 08:12 PM Jessy

I have added some screenshots to my question which include the stats window.

Sep 21, 2012 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, 2012 at 04:33 PM Screenhog

fantastic analysis screenhog, thanks for that!

Sep 21, 2012 at 04:41 PM Fattie
(comments are locked)
10|3000 characters needed characters left

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). ^^

more ▼

answered Jan 13, 2013 at 12:58 AM

avatar image

tatoforever
36 1 1 2

(comments are locked)
10|3000 characters needed characters left

Hi all,

I am trying to do like projecting a texture on the dress, But i dunno why its coming on otherside of the dress too, Can any one help me ?

Projection Problem

capture.jpg (59.1 kB)
more ▼

answered Dec 21, 2014 at 11:32 AM

avatar image

Quaker_SDR
186 1 4 4

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x172

asked: Sep 18, 2012 at 06:54 PM

Seen: 1700 times

Last Updated: Dec 21, 2014 at 11:32 AM