Into the shadows...

posted in Archipelago
Published March 01, 2009
Advertisement
So while I wait for a physics fix-up, I thought I'd take a look at that scary omnipresent todo-list item casting a dark shadow on my thoughts - erm... shadows. As is becoming usual with these game dev things, getting an initial implementation working wasn't nearly as hard as I thought it would be (umm standing on the shoulders of giants & all that). It's just that they're, well, ugly as sin really, with the requisite 'surface acne' and blocky low-res shimmery-ness close up. Using a huge shadow map texture (1024-2048 square!) close to the camera helps somewhat, though I've not done anything too clever with the light view and frustum yet (enter cascade shadow maps or similar).
Also, using glCopyYadder to capture the scene depth buffer was being limited by the app window size, so I've been forced to make the jump to using frame buffer objects too - delving into a rather arcane and temperamental part of OpenGL (boy is DirectX looking (slightly) more attractive nowadays, especially with the Longs Peak debacle. /me remembers back to my first blog comment...)
Getting the shadows integrated (I have to sample the shadow texture in each shader) also revealed errors in the ambient lighting calculations in the terrain and mesh shaders, which was nice.

Anyway, nuff yacking, here's how shadows change the look of the old gfx... (yep: could do with some textures about now I think). I'm now looking at overcoming the various idiosynchrasies as we speak. Ysaneya's journal has been quite helpful here describing his journey through the same territory.
Previous Entry Vegetative vagiaries
Next Entry M&B
0 likes 4 comments

Comments

HopeDagger
He lives!

Glad to see you posting more juicy progress. Shadows are something that always fill me with mixed-up feelings of dread. I have not yet taken on the grusome task of implementing them yet in any of my (luckily 2D) projects, but I can certainly feel for you. For what it's worth, they look quite nice in the presented screenshot. [grin]
March 01, 2009 04:55 PM
Norman321
Looks pretty awesome to me.
March 02, 2009 03:16 PM
daveybaby
That looks pretty bloody good from here too. All that needs (hmmmm... 'all'?) is a bit of anti-aliasing and youre good to go.

Actually, scratch that, you could easily get away with doing a simple bit of blurring to get rid of those harsh edges - say a 5x5 averaging filter?

Shadows are great. Lots of things you can do with them w.r.t. weather effects, time of day etc. Keep it up.
March 03, 2009 09:26 AM
MGB
Aye, still (just) alive :)

Unfortunately, that is a carefully selected screenshot :) You can see some faint acne on the edges of the RHS structure and the right side of the metal tower. And that's with a 2048 square map, plus quite far away (should really have put a Walrus on there for scale).
But yeah some filtering is in order - there's a few things I'm looking at, including the screen-space post-process method in the article here on GameDev.
All of which will eat into the frame rate - it's already taken a 50% drop by using FBO's though I suspect something is going wrong there - shouldn't have been that bad by all accounts.
Again, with my limited resources I can only go for the low-hanging shadow fruit unfortunately.

I did experiment with animating the sun position and it looked quite nice actually :) Maybe do a vid if I can keep the size small.
March 03, 2009 10:15 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Advertisement