[RELEASED] Projector Simulator

Hey guys!

My day job involves working with projectors and it was bugging me that Unity did not really have a good way to visualise a projected image, so I decided to see if I could rectify that. Here is the result!

Projector Simulator allows you to achieve realistic projector effects. Simply drop in the prefab and apply your selected image(s).

  • Project any image (or series of images) in colour
  • Enjoy realistic shadowing true to the light source
  • Fully adjustable lens shift, aspect ratio, lens ratio, brightness
  • Adjustable resolution for optimal performance
  • C# interface to control sequence playback (example included)

NEW in v1.3:
- Ability to project video files in real-time
- Ability to project RenderTextures in real-time

https://assetstore.unity.com/packages/tools/particles-effects/projector-simulator-86123


https://www.youtube.com/watch?v=DAZIvv-PAr8

3304062--256378--screenshot.PNG
3304062--256379--screenshot_1.PNG

This works mostly great for me. I love the inclusion of real-world specs like shift, keystoning, projector throw etc. But I've found it to be fiddly with colors - I've attached some images to demonstrate.

In this test scene, I have four projectors with the same content - a 1080p test image. For some reason, they're all showing up as green in my current configuration. If I turn all but one off, then they show up full-color. Sometimes, if I resize the game window just right, they'll show up full-color. Any idea why this is happening?

Test Image: 3571748--288148--test-image.jpg
Good Window Split: 3571748--288146--projector-scene-vs-game.PNG
Bad Window Split: 3571748--288147--projector-scene-vs-game-2.PNG

Hi Momo,

Any chance you are using Forward rendering? We have seen issues with strange lighting effects occuring when the Pixel Light Count is set too low - each colour projector adds 3 spotlights to your scene, so the Pixel Light Count (under Quality settings) must be increased to accommodate the new lights. Here we have a brief explanation:

https://www.youtube.com/watch?v=omjQqujDPV0|start=437

An alternative solution would be to switch to deferred rendering.

If this is not the issue, would you be able to share your scene/project?

Updating the Pixel Light Count to have 3*Number of Projectors in my scene fixed it, thanks! May I suggest adding this to the manual?

Another 'fix' to the problem was to use separate elements as 'Screens' for the projectors to hit, so that each object only had 3 lights hitting it. In my scene, I have one big room object with 12 lights hitting it with only 3 Pixel Light Count in my Quality settings.

Glad to hear you sorted it. Yes you are right, it should be added to the manual.

I don't know how fast I can get a response, but I recently downloaded this plug-in, and thought it works fine in the game window the image does not pop up in the preview tab. Any idea why this might be?

Hi Masterdd, honestly I've not come across this bug before. Can you include some example images? Is there just no projected image in the scene window? Sometimes an issue can occur where the projected image stops responding to the projector controls but this can always be fixed by playing and stopping play in the editor. Which rendering API are you using?

I'll admit I have not yet tested ProjectorSim with Unity 2018. Can you upload a simple project that exhibits the issue?

Sorry if I'm a bit confusing frankly I'm a bit new to all of this. Here's both my scene view and game view. I've tried restarting unity and playing and pausing but the projection doesn't show up in the scene view which makes it hard to line. I apologize in advance if I'm missing something extremely obvious, but I don't really understand why it's not showing up. I haven't adjust anything with the rendering API that I know of, so that could be it? Honestly am a bit clueless. 3772675--315163--Unity_GameView.JPG 3772675--315166--Unity_SceneView.JPG

Hi Masterdd, this certainly appears to be a bug. Perhaps in the meantime you can use the Game view to align the image, but I have not tested the current release on the more recent versions of Unity. There is an update to be released soon for optimisations, which may help. I will make sure to do testing on your version of Unity.

Come to think of it, the projectors have spotlights as children, so it is strange that they are not outputting any light in the scene view but they are in the game view. Can you inspect the individual spotlights that are on the projector? I suppose they must be on if you have a output I the Game view... what happens if you turn the spotlights on and off, clear the cookie etc? You might need to uncheck "live" in the projector before doing this to prevent the projector from overriding your changes.

Could you upload a screenshot of your project's graphics settings + quality settings? Does it work if you switch to/ from deferred rendering?

Also I've just realised I'm signed into the wrong account on mobile -_-

Oh all good. I feel like a idiot, but I did what you said to realize all I had to do was hit a lighting button on the scene window from a pop up in the spotlights. Thank you so much for the quick response though this tool is really helpful for me right now and having it work properly makes it 10x easier. Will definitely come back if any issues arise, but thank you a ton for the help!

Hi Masterdd, I was just making a cup of tea when that thought popped into my head! Rushed here to post it but you've already found the answer. I should have caught it as the rest of your scene window looked very flat. I thought you were testing me!

Another thing to add to the troubleshooting section of the manual I guess :smile:

Hey guys, we have the same need at Théoriz, we use professional software computing and simulating brightness on surface, pixel and light density etc.

The thing is that we do most things in unity and our workflow would be so much better to do everything there.

Since hdrp is computing light aspects in a physical manner i.e. Lumens etc. It should be easier now to build some nice simulations. Also the video player of unity and some hap unity player on vimeo got really good recently.

What do you think ? Is this something you consider? Or maybe we can build it together?

All the best

Hello.. Do you think this asset would work for my project which involves projecting a sprite image onto a spatial mapping mesh obtained from the hololens? Anyone tried this out? Thanks!

Hi Mebinb2,

I'm afraid I don't know enough about the Hololens to comment. Projector Simulator uses standard Unity Spotlights to create the projection effect, so you could test to see if your mapping mesh can "catch" light from (several) spotlights first? If you have a red, green, and blue spotlight with the same cookie, does it appear as white light on your mesh?

Thank you shwhjw! I tried to follow your suggestion.. I could not get any any projection using the spotlight on the spatial mapping mesh. I suppose this could because the spatial mapping mesh shaders available from Holotoolkit does not support this. I may have to dig deeper into shaders.. Any other suggestion?

I seem to be running into an issue where none of the projectors seem to be turned on when I build a scene using the projectors. Everything seems to work fine in the editor, but then if I make a build, using for example the testing or ProjectorControl scenes, the projector images do not appear. Do you know why that may be? I have my camera's rendering path set to Deferred if that helps.

Hi Dangrover1,

This was a known issue when the new shader method (1.4) was initially released but it was quickly fixed. The cause of that was the shaders used during processing were not being included in the build. Can you confirm that you have 3 shaders located in ProjectorSimulator\Scripts\Resources?

If you make a development build do you get any error messages showing up?

It might be worth enabling the "use legacy method" on the projectors which will cause them to fall back to the non-shader approach (although one of the projectors in the test scene should already have this checked), just to see if that suddenly makes it work. If so, it points to an issue with the processing shaders.

I have just built the test scene with both deferred and forward rendering and it appears to work. Can I ask which version of Unity you are running? Would you be able to share your project folder so I can check your other settings?

Hi shwhjw, thanks for the quick response! After your suggestions, I made a build in development mode and discovered that the shaders were not being included with the build. Afterwards, I have now made sure that they are included and that seems to have fixed the issue. Thank you for the help, sorry that I overlooked something small like this. Thanks again!

Hi dangrover1,

Glad you sorted it! I thought I had fixed that issue... Were the shaders in the Resources folder?