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?
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…
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.
The ball bounces on top of the box - it’s just a quick bouncy ball demo!
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…
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.