Hello everyone! I have discovered an interesting way of having “realtime” shadows in the game engine.
blend: http://www.pasteall.org/blend/18432
ASWD movement of cube in game
I hand-painted the shadows so they do not look very good. The shadows can run 3 times faster (or more) than normal shadows. For a simple on-the-ground game this technique could be very useful.
The way I was able to do this was by using an alpha texture and have global mapping for it.
Please give input on how this shadow technique could be improved.
Prebaked shadow and light maps were often used in older games, but this has the drawback that you can’t animate lights nor the geometry. There’s a wide variety of ways to do shadow mapping these days, maybe check out this article for more information: http://en.wikipedia.org/wiki/Shadow_mapping .
Instead of Painting them by hand you can also use blender render to generate them for you.
Well, with this method, you can actually change lighting by fading off the shadow map via IPO editor. Plus, I made this so that the cube/s you see are actually affected by the the shadow. They can move around and aren’t just baked into the environment.
Yeah, that’s a nice technique. It works fairly well, actually. I did something a bit cruder with Python awhile back where I got the color underneath the player and adjusted its object color accordingly. Very nice work.
what about using a sphere with collision detection that knows which vertice was closest, the “Light” spawns every X frames, scales up each frame, and on collision it lights up using vertex color, and then reduces the vertex color level, this would cause shadows, and on each scale up, reduce the value of each vertex color, so
iteration 1 - Color = <1,1,1> - collisions
Iteration 2 Scale=Scale+X, color equals color - <Falloffx,Falloffy,Falloffz>-new collisions
and so on.
@BluePrintRandom
I’m not a programmer (hence, why I look for optimizations), but I think I know what you are talking about. For low-poly models it wouldn’t look very nice, but I’m not sure about performance for it at all. If you just lowered object color when it came in contact with a certain area, it would look good enough.
it would use the collision on the object to uv map a brush, so it would not be face dependable, so it edits an image based on a collision, only one image exists, that is edits each frame, so the map is the emission,
So we have, 1 fully lit uv map, 1 map that is added to it that is black when it starts, when particles strike the surface, you use that collision to place a brush that is a falloff, so enough particles = fully lit.