Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!






Into the shadows...

Posted by Aph3x, 01 March 2009 · 267 views

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.





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]
Looks pretty awesome to me.
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.
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.

December 2014 »

S M T W T F S
 123456
78910111213
14151617181920
2122232425 26 27
28293031   

Recent Entries

Recent Comments

Recent Entries

Recent Comments

Latest Visitors

PARTNERS