   How does he do this? Getting shadow information back to the CPU
  I was just watching this video:">In that video, he plays a character who is interacting with the shadows of objects. And I would really like to know how to do something like that. How does he get the shadow information back from the graphics memory? And how does he know which objects belong to the shadows? (as in the example where he pushes the shadow of a ball, and the ball starts rolling)The only way I know would be with glReadPixels, but as far as I remember that is really slow. And he is running of a laptop, so there can't be anything too beefy in there in terms of hardware.[Edited by - Sagan on April 28, 2009 2:56:23 PM]
  He may be performing the physics itself on the GPU, although this can get quite complex. He could also be reading back the shadows - you can do some tricks with pixel-buffer-objects and ping pong techniques to speed up readback.   ;  Can you explain that further, or do you know of any tutorials? It could really be useful if I could quickly read back data from the graphics card. I don't even need all that much. Maybe 2000-3000 pixels per frame. So what are those "tricks with pixel-buffer-objects and ping pong techniques"?   ;  Although I think that the following don't solve the actual problem of the OP:I don't know how he's doing the thing, but I see no real need to read shadows back from the GPU. Instead, I would compute shadow volumes from the 3D scene (on the CPU; the scenes seen there are simple) and project them onto the walls, floor, and ceiling. Due to this method you always knows which "shadow" belongs to which object, and furthur from which light it is projected. Then pushing the ball's shadow (as an example) means to detect a 2D collision. The direction of collision can be unprojected (you know the light) and hence be used to determine the direction of a force/impulse applied to the object to initiate its physical reaction in the 3D world. Something like that.   ;Quote:Original post by SaganCan you explain that further, or do you know of any tutorials? It could really be useful if I could quickly read back data from the graphics card. I don't even need all that much. Maybe 2000-3000 pixels per frame. So what are those "tricks with pixel-buffer-objects and ping pong techniques"?You use a pair (or more) of pixel buffer objects, and cycle between them. The pixel buffer objects let you read asynchronously from the graphics memory, but the downside is that you don't get the results until several frames later.   ;  From watching that I can't really tell what kind of technique he was using for the shadows, but if I wanted to do something like that I'd probably go for Shadow Volumes, which create geometry that can just as easily be kept on accessible memory. All you have to do after that is point-to-line collision where the line is the projected edge of the shadow volume on the surface the shadow was casted on.It's not a simple process, but the concept is (I think).   ;  >>glReadPixels, but as far as I remember that is really slowI havent looked recently, whilst its defenitly not fast.its not slow like it once was, i.e. the scene would freeze whilst u done a read, now its possible to maintain a semi-fluid framerate whilst calling it   ;  As far as I can see, the unit only walks on the 6 walls of the level, not on any cross shadows between objects in the scene. So, this reduces the problem to projecting your 3D scene objects onto the 6 different planes of your level box and then its just a 2D game with these projected objects. At least I think this is what they did.   ;Quote:Original post by dietepietAs far as I can see, the unit only walks on the 6 walls of the level, not on any cross shadows between objects in the scene. So, this reduces the problem to projecting your 3D scene objects onto the 6 different planes of your level box and then its just a 2D game with these projected objects. At least I think this is what they did.I agree! I think they don't use shadow information at all. They do 2D physics in the "screen space" of the light and transform back the forces into 3D.;  I found an interview with one of the developers:http://www.indiegamepod.com/2009/04/video-podcast-interview-experimental.htmlHe explains it:It's all shader model 3 stuff because we're doing collision detection, like classic per pixel platform collision detection against the shadow map that is generated in real time in hardware using standard shadow mapping techniques.So if he does all the collision detection in the shader, then he has to send very little information back to the CPU.   