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

Shadow volume testing C++ OpenGl

Loading...

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

Uploaded by on Sep 28, 2010

A really quick demo I slammed together in about 3 hours.

I was doing a lot of reading on shadows and the methods used, and I decided the best way for me to learn was to just try it by myself.

So, I started simple and make a copy of all the geometry in a shape that was facing the light. I then translate each vertex in a direction based on the lights current position, untill it hits the floor plane.

Very simple, yet very effective. I used the stencil buffer to only draw onto the floor. There is a problem with the poly pipe; there is lots of Z-fighting going on, because two different sets of polygons are being translated back ot the plane, on top of each other. I either need to create some sort of sillhuete detection, and create an entirely new shape from that, or, get the objects to cast self shadows to stop the overlapping.

Either way, I am pretty happy with the results in such a short space of time. I'm now going to look into how the pros do it, and start using another buffer to store the lights depth buffer, and use that to create a shadow texture.

Category:

Gaming

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (2)

Sign In or Sign Up now to post a comment!
  • @retropixlstudios Hey dude, cheers for the comment. Oddly enough, the method I use here is sort of similar to shadow volumes, which is a very high tech method of creating shadows. I use shadow mapping at the moment, it's fast, it's easy and the overall effect can be tweaked very nicely. (also, the silhouette method is probably using the adjacency buffer in D3D! Have a look for it, it's an interesting method :) )

  • To do that sillhuete thing you could do this: take the normals or the faces, take the normal (direction from the face) of the light and if it is back facing remove it. I read a slideshow I found somewhere on how to do this and optimize it, it could probably explain it better than I can, let me try to find it.

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