Wednesday, June 23, 2010

shadowy goodness

I keep wanting to push my way out of town with trees, grass and such, but there's so much to do around the garage that i haven't moved much. I came across some sneaky tricks on the support forums that help with optimizing performance, while at the same time, allowing me to put some shadows on stuff. I've completely avoided attaching shadows to anything thus far because it brutally impacts the framerate, but now i've got some ways to make it work right. :)

Basically, I've removed hit detection from anything that isn't directly on the side of the track. The fewer polys of grass and tree crap that the game has to calculate as a solid object, the better. Since i've been meaning to surround the whole track with high invisible walls anyway, this has been a good reason to start doing that. So - i removed hit detection from the fancy fences i've been using and dropped a smooth, invisible wall right on top of them. This will make accidentally hitting the fence a much easier thing to deal with. Using the fence's natural hit detection made it so that you never knew if it was going to send you flying or knock you completely through it and off on to the surrounding terrain. Now you'll just casually glance off it and keep on your merry way.

Making it so that the only solid object next to the tracks are either buildings or the invisible wall has made it so that i can turn shadows on for trees and such without it annihilating the framerate. Now that i know this trick, it could totally change the way that i build the next town. Like - i might make ALL structures and most of the objects intangible, but with a low-poly, invisible wall in front of them. This will make it so that i can really polish the look of things with shadows and other cool stuff without screwing anything up.

So - here's what the shadowy scene is looking like at the moment. This is a pretty bad spot to try and show it off because the sun doesn't rise or set in a spot that throws the shadows on to the pavement, but you can still see them hanging out at the base of trees. This will look really cool in other spots at different times of the day:
Oh yea, and i can't get shadows to come off of that fence for the life of me - it's broken somehow and would probably be too complex anyway. But still, it'd sure look nice if i could get it to work. And here's a shot from inside the track builder - it shows the nice treeline i've been working on around the start of town.

No comments:

Post a Comment