- Home /
fake shadow with least performance hit
Hello all, Looking for the best way to create a shadow effect without losing too much on the performance side, preferably nothing :). Here's what I'm doing:
This is a shadow for a square. That's it. the shadow should move with the square, but the quality is pretty much irrelevant as long as it has some falloff and it's a square shadow moving with the square mesh, so no realistic shadow effects needed. this is a 2d game so you will never see the shadow from any other angle.
Any help would be appreciated
EDIT: In response to people posting about the blob projector,would a blob projector be less memory intensive than just an image of a square that has an alpha?(since this is a 2d game, the shadows don't exactly have to project)
Answer by Eric5h5 · Mar 01, 2011 at 01:21 AM
Assuming the ground is flat, use a quad with a transparent texture for the shadow. Blob shadows can be expensive because they re-draw the entire object even if the shadow is projected just on a small part of it.
Answer by Rolo · Mar 01, 2011 at 12:22 AM
check the lerpz tutorial for blob shadow.
http://unity3d.com/support/resources/tutorials/3d-platform-game.html http://download.unity3d.com/support/resources/files/3DPlatformTutorial.pdf
Answer by e-bonneville · Mar 01, 2011 at 12:23 AM
Use the Blob Shadow Projector if you just need a fake square shadow with nice falloff.
thanks for the response. please see the edited comments
Answer by Bunny83 · Mar 01, 2011 at 01:23 AM
Well, i'm not 100% sure how the projector works internally, but i think he just add the projector material to all objects in his frustum and adjust the uv-coordinates accordingly.
Performance is relative. The projector may have more cpu usage, while a seperate plane can cause another draw call. If you develop for iPhone (I'm not an iPhone dev.) it's important to keep the draw calls low (very low: around 20 what i've heard). In the end it depends on the platform and hardware you develop for. Sorry but can't say much more on that.
Maybe Eric can enlighten us. ;D
"20 draw calls" was more or less appropriate in 2008; the iPhone has advanced several times since then, and there isn't just one model anymore. Also, that isn't really how projectors work, and using a projector adds another draw call for each object it touches.
Your answer
Follow this Question
Related Questions
Low frame rate with only one texture on iPad 4 Answers
ex2D performance 1 Answer
Lagging on iphone 4 while worked well on iPhone 3GS and 4S 1 Answer
How expensive are coroutines on iPhone? 3 Answers