Blob Shadows... AGAIN!

Hey, all,

Just to help me get my head around Blob Shadows, I created a little app with a ball bouncing on a surface and 4 empty objects projecting a blob shadow toward the ball.

Once I’d overcome a few issues, this worked perfectly in the editor - no hassles at all.

When I uploaded it to the iPhone, it all went to hell - the shadows jump all over the place and project at the wrong sizes and all sorts.

I realise that’s not much in the way of information, but does anyone have any idea what I’m doing wrong?

Cheers,

SB,

Maybe attaching a small example of the set-up would help.

Hi,

If you are using projectors, be aware of the following:

  1. This adds a render pass to each object being projected onto.
  2. Make sure projected texture is set to clamp instead of tiling (or shadow will repeat indefinitely over the surface).
  3. Disable mip-maps on the shadow texture. Frequently on the low mip level you will just see shading artifacts all over the surface.

Hmmm… I’d already covered what you suggested, Adam, but to no avail. I don’t know if I’m doing something wrong, but basically, I’ve got 4 empty objects which contain projectors. One at each corner of the “screen”.

There is a script in the projector which basically tells it to “lookat” the ball:

var Obj: GameObject;
var Parent: GameObject;

function Update()
{
      transform.position = Parent.transform.position;
      transform.LookAt( Obj.transform );
}

Other than that, there’s not much to it! The object they’re projecting onto is a standard 12-polygon, 6 sided box - nothing special at all.

The settings for the projectors are as follows:

NearClipPlane = 0.1
FarClipPlane = 100
FieldOfView = 8
AspectRatio = 1
NOT Orthographic
Ignore Layers (Same as “OBJ” in the code above)

All works 100% in the editor, on the iPhone it looks like the shadow texture is actually being textured incorrectly onto the individual polygon faces of the object I mention above…

Any ideas?

Can you take a screenshot on the device? Just press home button and lock button at the same time and it should make a picture.

OK - here we go. Some images.

The top one is in the editor:

and this one is what happens when the same code is uploaded onto the iPhone:

Any idea what’s causing that, then?

I ran into the same problem with my app where the shadows would show correctly in the editor but flipped out on the iPhone.

We only ran into the problem when casting blob shadows onto angled surfaces, and the problem got more extreme when casting the shadow onto long or thing polygons.

We didn’t find a fix, but our solution was to tesselate the ground more uniformly on any ramps or angled surfaces, and this reduced the shadow warping but didn’t fix it entirely.

Should this be raised as a bug in Unity, then? At the end of the day, all it’s doing is projecting onto a 2-polygon flat surface (like so:

-------------
|\          |
| \         |
|  \        |
|   \       |
|    \      |
|     \     |
|      \    |
|       \   |
|        \  |
|         \ |
|          \|
-------------

I’m at a bit of a loss as to what to do to sort this out when it works 100% in the editor… :?

So, to make sure I’m clear, is your scene inside of a box, or the sphere is resting on top of a box?

The ball bounces on top of the box - it’s just a quick bouncy ball demo! :slight_smile:

Nothing suspicious at all - 100% straight forward, and the projectors are set to ignore any layers which could cause problems, but it just melts down completely on the iPhone itself… :frowning:

Yeah I did some quick tests. Looks like orthographic projectors behave exactly as expected, but perspective projectors produce the result you’re seeing. I’d go ahead and bug report it.

Has there been any progress on this issue?
I have a character walking around on a surface with large polygons and the shadow dances all over the place relative to the charater depending on the slope of the surface, the distance of the projector from the surface and so on.

I tried also to create a following object for the projector which always points directly down on the world Y, but this doesn’t seem to help.

Are you using the blob shadow that now comes with iPhone Standard Assets? (as of Unity iPhone 1.5)

No, unfortunately there’s been no progress - I’ve just tested the project on the newest version of Unity and it still does the same thing…

:frowning:

with the assets provided for the blob shadow with unity 1.5 or your own?

Hm. We’ve corrected few blob shadow bugs. Please submit a small project via bugreporter for us to recheck.