I get strange results using the projector component together with the standard asset ‘Projector Light.shader’ and a texture with wrap mode set to clamp. The projector emits light sideways and backwards as well as forward.
How do I set up the Projector component to simulate the behaviour of a video projector?
The falloff texture is needed, but more importantly is that the texture you’re feeding the projector can’t have any RGB information at the borders… ie, you need to have a transparent border around the image. In this case if you’re trying to use a video clip, which doesn’t support alpha channels, you will need to create a custom shader that uses the video clip as the main texture and a separate texture as the alpha border.
If you’re using an additive projector then you could put a black border around the video clip.
Zero alpha border and a falloff gradient texture does not seem to fix the problem entirely. It is now overly bright and the image is still repeated in the backwards direction. I also get flickering on one of the walls when I turn the camera.
I would highly appreciate if someone could set up a simple example.
Thanks Ethan. This is big improvement. However I still get some strange effects round the projector and when I turn the projector 360 degrees slowly sometimes it draws the projection in the opposing direction. I wonder how I can tweak this.
The shading looks different on the attached screen shot because I added a PointLight.
I can’t reproduce that issue. Can you post a screenshot of what you’re seeing? Do you mean that the projection shows up in front and behind the projector? If so try adjusting the falloff texture with more black at the beginning of the ramp (the white side).
Thanks again Ethan. I managed to get a perfect result by fiddling with the gradient texture and increasing the black border size on the projected image. I had to increase the border to 42px. It feels like an ugly hack (because pixels are wasted), but it works.
Hey, i tried to open the packages because i need the same effect. But when i try to import it, unity will throw me a error, that it can not be decompressed. Can anybody send me that package for the current untiy-version or zip it? that would be great