Jump to content
  • Advertisement
Sign in to follow this  
Jim1664

Shadows 2D

This topic is 2223 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello people,

So, I just wrote some cool code, and I feel like showing it off a little.

To summarise, it's for rendering soft shadow casting lights (lots of) in a grid based 2D-world.

It is similar too the likes of: http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/dynamic-2d-soft-shadows-r2032
But it differ by working out contiguous non-overlapping geometry so as not have too a shadow accumulation step for each light. Also, in the second version, lighting geometry as opposed to shadow geometry is generated. Actually generating the geometry is a fair bit more complex, it still runs well in realtime, but then rendering it is much simpler. In the spirit of a typical 3d deferred renderer each light and each object are rendered once, [color=#222222][font=Arial][size=2]separately[/font] and then combined.

I was intentionally brief, I am quite new to 2D stuff, as far as I know this method could already be wide spread. If people care, I will elaborate at request, else I'll just fade quietly back into the woodwork and try again when I have something even more awesome.

Attached are in action screenshots, taken from Darkout, indie game I am part of. Link: http://www.darkoutgame.net

Thats all folks.
-JimC

Share this post


Link to post
Share on other sites
Advertisement
They look preety neat. Is this the exact implementation of http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/dynamic-2d-soft-shadows-r2032 ?
On an unrelated note, your game looks pretty interesting. Keep up the good work.

Share this post


Link to post
Share on other sites
@clickAlot

Thank you,
And no, it is the same basic concept but implementation is quite different. The most obvious difference is; in the article trapezium's are generated from projecting the far edges of shadow casters away from the light origin, which are then used to "draw" shadows. Here we form triangles from light origin and the closest edges and use them to draw the lights directly. Additionaly any would be overlapping triangles are unionified.

-JimC

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!