Soft Shadows

BlitzMax Forums/BlitzMax Programming/Soft Shadows

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yah that's an interesting link although it looks more like a `light and shadows` demo than a game at the moment.

If you read some of the comments that follow that first article about the soft shadows, someone suggests putting vertices around the edge of irregularly shaped 2d objects and then using those as the `corners`, but I think if you do that you're going to have a lot of very thin polygons all over the place.

I guess it kind of depends on how your game environment is structures as to how you would think about doing lights and shadows.

Like I said before somewhere else, there is no such thing as shadows. Things begin with darkness and any light that you add creates areas that are lit - any untouched areas remain dark - ie shadows. So you can either model the shadows, or you can model the light. Or both. It's kind of tied in.

Also, try casting shadows that are produced by a detailed particle system. Lots of work.

Shadow-casting is really about line-of-sight, whether the light is visible from a given pixel and if so how much of it. Soft shadows are just produced by the fact that the light source has some width, so certain amounts of it can be seen from different angles. It's not really any different than hard shadows being cast by pinprick light sources.

I think you probably will either way have to make your own OpenGL/DX engine in order to implement them well.

It looks like the Max3D module has an automated shadow-casting system using a similar technique to the above article - ie with shadow volumes. Seems like a lot of work though.

That second article that TonyG posted, looks like they use a raycasting technique where you shoot rays out from the light source in lots of directions and find what objects each of the rays hits, which forms surfaces to create shadow polygons. It's a lot like how game engines like Doom etc do raycasting ... tracing lines across a map until you hit surfaces, speeded up by using something like a Binary Space Partitioning tree or a quadtree/octree.

I'm planning to have lights/shadows in the game engine I'm working on and I was thinking to use the latter technique, but the softshadows technique suggests it could be done without needing to cast rays so blindly. I guess if you know which objects occupy what areas, though, you can just cast rays through those areas to find the perimeters.

*shrugs*