- Home /
Possible bug with projector/s
I'm using Unity 5.3.1f1...
The goal is to use projectors to "project" lazer scorch marks (/bullet holes) onto "stuff" (one of the recommended applications for projectors in the docs [ http://docs.unity3d.com/Manual/class-Projector.html ])...
It sort of works, but I'm encountering some odd visual glitches (no glitches with the first few scorch marks, but things get weird after 30 or so)...
For reference, here's a shot with no projectors in the scene:
and the possible bug:
The purple on the ice and weird shading on the "cannon base" should not be there. Both artifacts move around when the main camera moves, but only a little; the purple stays on the ice, and the weird shading stays on the cannon base.
I have a pool of 100 projector objects. Besides positioning the objects (I think they are positioned correctly; they are positioned where I expect), my scripts aren't touching the projector components themselves.
Thoughts?
Update: 2 steps forward, 1 step back. I re-examined the blob shadow from the standard assets, and realized I had failed to properly set my scorch mark texture's format. Switching the format to "Automatic Truecolor" made the purple and weird shading go away.
Unfortunately, whenever a projector lands on a sharp edge between two objects (the bottom edge of a cube where it meets the floor for example), the projection is ridiculously stretched. I would have thought the projected texture could not stretch past the near and far clip planes of the projector; but they are. Besides stretching, the projectors are only visible from a very short distance. They're invisible just a few steps back.
Here are some links to more screenshots: https://drive.google.com/file/d/0BwNPOufI_syBZG9HUWY0OTJ4emc/view?usp=sharing https://drive.google.com/file/d/0BwNPOufI_syBTVE5cWZzcFNvUjA/view?usp=sharing https://drive.google.com/file/d/0BwNPOufI_syBUVF3Wk9xX0pyZEk/view?usp=sharing https://drive.google.com/file/d/0BwNPOufI_syBT2FsSlRYbUdOZWs/view?usp=sharing https://drive.google.com/file/d/0BwNPOufI_syBbWNoelR2ai1kbDQ/view?usp=sharing https://drive.google.com/file/d/0BwNPOufI_syBNmRzNmg0VXF2YTA/view?usp=sharing https://drive.google.com/file/d/0BwNPOufI_syBbjNQNEdwYTg4UlU/view?usp=sharing
UPDATE 2: Just noticed some more weirdness; when the projectors are on a moving object, the projections can end up all over the place.
https://drive.google.com/file/d/0BwNPOufI_syBM00zSkEwdGcyRVU/view?usp=sharing https://drive.google.com/file/d/0BwNPOufI_syBYllUdzhHellNak0/view?usp=sharing
In addition to undesired stretching/projecting, the projectors are only visible from a set (typically short) distance. I have tried playing with the projector settings, but nothing I tried had a noticeable or positive effect. The exact distance varies, but I have not determined based on what. Sometimes the projections are only visible with the character standing directly in front of them, and the camera zoomed in. Other times, they are at least faintly visible from a reasonable distance... weird.
I just realized I forgot to include my projector settings...
Near clip plane: 0.2 Far clip plane: 0.25 Orthographic: true Orthographic Size: 0.025
(unfortunately I can't seem to upload anymore pictures at the moment)
Answer by copperlizard · Apr 09, 2016 at 05:33 PM
I sort of got things working this morning. I'm just not totally sure why yet. I can say how though.
The original "bug" (the crazy purple light and weird shading) was fixed by setting the scorch mark texture format to Automatic true color.
The "view-able distance bug" went away when I disabled "generate mip maps."
The "stretching projection" went away when I switched from using my own falloff texture (in my projector material) to the one in the blob shadow standard asset. I don't know why. I'm certain my falloff texture is set up the same way (just with a different gradient of course). I created my textures using gimp...
Anyways, the standard asset falloff texture works well enough for me (for now).
Your answer
Follow this Question
Related Questions
Changing Skybox tint in game, permanently changes it in editor? 1 Answer
Why is unity lagging so much? 1 Answer
Editor Camera moving while rotating 0 Answers
Sprites Leaving Trails Glitch? 0 Answers
Weird Placement Glitch 0 Answers