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

OpenGL Stencil Shadow

Loading...

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

Uploaded by on Jun 3, 2011

This is my first attempt at making a simple shadow on a plane. (Also, it is one of my first programs using GLX instead of SDL or GLUT.)

These are the rendering steps:
1. Draw the ground plane normally.
2. Draw the ground plane again into the stencil buffer, so that the following shadow doesn't extend over the limits of this plane.
3. Draw the model, scaled with y=0 (so it's flat) and moved to the plane, with a black color, alpha blending (so the ground texture is still visible a bit), with special stencil operations (to avoid double blending) and no depth testing. This is the shadow.
4. Draw the model normally.

At the resolution seen in the video (640x480), my graphics card, an NVidia GeForce GTS 450, renders 1000 frames in about 0.1 seconds, reaching almost 10000 FPS :^]

Computers are awesome and OpenGL is fun!

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (4)

Sign In or Sign Up now to post a comment!
  • @Edange I don't think the method used in my program is either one of them, but I'm not sure.

  • Shadow map, Shadow volume?

  • @Danny77uk Thanks :-)

  • Impressive

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