6
\$\begingroup\$

I have a lot of billboarded 3D spheres (they have a heightmap so work properly with depth and penetration; although each is made of just a quad (with slight distortion), they look and feel and are true 3D spheres): http://www.youtube.com/watch?v=88idbFlvQV0

The choice of using billboards is for throughput on low-end hardware.

How can I effectively cast shadows from these? It occurs to me that using proper shadow-volumes will take a lot of fill-rate and complexity. I am fill-rate sensitive.

I was wondering if there is any way to billboard the shadows cast by my billboards?

\$\endgroup\$
5
\$\begingroup\$

Yes, it's very possible. And should suit your needs for speed well, as this used to be common practice amongst older games.

A very good reference is the old tome by André LaMothe: Tricks of the 3D Game Programming Gurus (Chapter 14).

The basic jist of it is to simply project a shadow version of your billboard onto the floor. A more advanced version for arbitrary Meshes can be found Here

\$\endgroup\$
2
  • 1
    \$\begingroup\$ And since he's using spheres, figuring out the proper shadow shouldn't be too difficult =) \$\endgroup\$ Sep 19 '11 at 9:23
  • \$\begingroup\$ As my spheres have depth, despite being billboarded, I'm thinking I have to compute the depth in the shadow too.. if it was not too difficult I wouldn't be asking =) \$\endgroup\$
    – Will
    Sep 19 '11 at 16:53
3
\$\begingroup\$

It sounds like your billboarded spheres are outputting depth when you draw them into the main view, so you could use shadow mapping and just draw them into the shadow map exactly the same way.

\$\endgroup\$
3
\$\begingroup\$

Do you have access to programmable shaders? If you do, setting a depth map to project sphere shadows would work easily.

What you need to do is set an alpha mask texture (if you're not using one already) for the billboards and in the shader if the alpha value from the texture is less than 1, tell the shader to discard the pixel/fragment. That way the pixels don't get counted towards the rendering of the depth map and they will show up clearly as circles instead of squares when you don't check for alpha.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.