Blob-Shadow???

So I have objects falling from the sky (iphone game) and I was told to use a projector and blob shadow for it, so the player could see it coming and try to dodge it. The problem is, I added the Blob-Shadow folder to my game from standard assets, put one in the scene and set up the different stuff and something weird happened. I attached two pictures, one of what happened and one of how I set up the blob shadow/projector. Help???


Well I got it to at least show up using a different shader, but now it pretty much polka-dots the entire scene???

Try using this shader:

Shader "Projector/Projector Multiply"

{ 

Properties

{

    _Color ("Main Colour", Color) = (1,1,1,0)

    _ShadowTex ("Cookie", 2D) = "gray" { TexGen ObjectLinear }

}



Subshader

{

    Tags { "RenderType"="Transparent"  "Queue"="Transparent+100"}

    Pass

    {

        ZWrite Off

        Offset -1, -1



        Fog { Mode Off }



        //AlphaTest Greater .1

        AlphaTest Less 1

        ColorMask RGB

        Blend One SrcAlpha



        SetTexture [_ShadowTex]

        {

            constantColor [_Color]

            combine texture * constant, One - texture

            Matrix [_Projector]

        }

    }

}

}

Can’t remember if it was a Unity default shader or if it’s from the wiki or something.

It works, but it makes shadows everywhere, so it polkadots the entire scene

No… use one of the Standard projectors.

Also, when you import the texture you need to have the turn the Wrap Mode to Clamp (it is at the top of any texture)

Hm, maybe this tutorial helps you a bit: http://www.youtube.com/watch?v=qMsTBlUeXlU

That is exactly how my thing is set up other than his fall-off texture (didn’t see it included in the standard assets). This is what happens to mine (first picture, second picture is how its currently setup) I’m using the shader the guy above you posted (and yes I tried the other projector shaders with the same result).

612722--21806--$ShadowV2.png
612722--21807--$ShadowSetup.png

Watch the tutorial again. pay particular attention to about area 5:50, he discusses clamping the texture, which you may have missed.

Didn’t even see that part, thanks. Works great now.

Sorry to bother everyone again, but after I added it to the items, and had them start dropping, I got weird shadow lines and stuff, I attached a picture. Why are those there?

I think i have seen this lines before. But i cannot remember the solution, sorry :frowning:

Thats ok, I’ll keep looking.

EDIT: Switched the shadow image from “Compressed” to “16-Bit” and its working much better, don’t see the lines anymore.

You can also fix that by checking Border Mip Maps under the image settings.

Without it, some of your edge pixels are becoming grey due to filtering, and because its a clamped texture, those edge pixels then get smeared across the rest of the mesh.

Ok one last question. This is for an iphone game, and with only 4-5 objects onscreen with blob shadows it slows the game down considerably, is it something I did or does the iphone just not handle them well?

4-5 is too much unless you have a highly optimized environment with many distinct meshes.
Reason is that each object thats hit by a projector is drawn again for it, which has some pretty beefy consequences naturally especially on fillrate

Ok, hmmm… I’ll try one of the other shadow ideas I had, its basic but it will do what I need it to. (just make a seperate smaller mesh the same size as the object and then just place that under the object at ground level).