Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

OpenGL 2D Lighting Almost Complete

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
5,552
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 27, 2011

An obstacle is created on left click, and a light is created on right click. The Light is rendered as a radial gradient onto a texture buffer. Shadows are then calculated and rendered on top to 'block' the light. The completed light texture is then overlain onto the rendered image. The process is repeated for each light in the scene with successive uses of the texture buffer. Each light is recalculated each frame; this is unnecessary in an example like this, but will enable dynamic lighting of any scene in which the obstacles are defined by a set of vertices, indices, and vertex normals.

Source Code(.zip)
http://dl.dropbox.com/u/21442669/2dLight%20source.zip
scanned with Malwarebytes Anti-Malware for your safety. :)

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (akikid297)

  • Do you still have the source for this? im a games programmer studying at AIE in australia, this would be a great help :D

  • @Litruv @davidamador Yes, I will be making the source available for you guys soon. I've been really busy and I have finals this week at the university so it will be sometime next week. Thanks for watching!

  • @davidamador @Litruv The source link is now in the description. Good luck with your programming!

  • can you make a software for that ...?

  • @MomoShow9 I'm not really sure what you mean... I wrote the program shown here in C++.

  • Nice work! What language are you working in? I'm also trying to achieve 2d lighting.Does your system of shadow casting allow other shapes or its it just rectangles?

  • @thecoast47 This was done in C++. The engine allows for any shape so long as surface normals can be calculated. This means that a shape could also be defined mathematically. If you're interested I can post another video of the completed engine including dynamic lighting and non-square shapes.

see all

All Comments (12)

Sign In or Sign Up now to post a comment!
  • gooooooooood

    thanks

  • you are awesome. thanks for the source

  • Is it possible for you to share the code? or a little explanation? you can catch me at david_djlink@hotmail.com

    Thanks

  • This makes very beautiful images!

  • @akikid297 I'm very interested. Please, show me what you've done.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more