Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Shadows 2D


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 JimC1664   Members   -  Reputation: 179

Like
0Likes
Like

Posted 11 June 2012 - 02:12 PM

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, separately 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

Attached Thumbnails

  • Darkout_SCR @day162  @time17-33-23 .jpg
  • Darkout_SCR @day162  @time18-10-25 .jpg
  • Darkout_SCR @day162  @time17-59-29 .jpg


Sponsor:

#2 clickalot   Members   -  Reputation: 173

Like
0Likes
Like

Posted 13 June 2012 - 03:36 AM

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.

#3 JimC1664   Members   -  Reputation: 179

Like
0Likes
Like

Posted 13 June 2012 - 07:56 PM

@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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS