Login    You have 0 item(s) in your Shopping Cart  

 
 
previous | up | next 
PCF Shadow Mapping with GLSL


 E-mail this product to a friend

Author:  DigiBen

This tutorial builds off of the previous GLSL shadow mapping tutorial and implements "Percentage Closer Filtering".  Percentage Closer Filtering, or PCF, takes some surrounding depth values in the shadowmap and adds them up, then dividing by the number of samples taken to create an average.  This average will then be the current shadow value for that pixel.  This technique gets rid of aliasing around the edges of the shadowmap.  We use a 3x3 kernel, which means that we only take 8 surrounding pixels, including the middle pixel, to create the average.  The effect creates blurring around the shadow.  The more samples you use the better the quality and less aliasing you see.

Functions Used:  glViewport(), glMatrixMode(), glLoadIdentity(), gluPerspective(), glClear(), gluLookAt(), glBegin(), glEnd(), glLightfv(), glPushMatrix(), glPopMatrix(), glNormal(), glColorMask(), glGetFloatv(), gluPerspective(), glActiveTextureARB(), glMultiTexCoord2fARB(),  gluNewQuadric(), gluQuadricDrawStyle(), gluCylinder(), gluSphere(), gluDeleteQuadric(), glTexParameteri(), glTexGeni(), glTexGendv(), glLoadMatrixf(), glMultMatrixf(), glPolygonOffset(), glCopyTexSubImage2D(), glCreateShaderObjectARB(), glShaderSourceARB(), glCompileShaderARB(), glCreateProgramObjectARB(), glAttachObjectARB(), glLinkProgramARB(),  glUseProgramObjectARB(), glGetUniformLocationARB(), glDetachObjectARB(), glDeleteObjectARB(), glGetString(), wglGetProcAddress(), glGetInfoLogARB(), glGetObjectParameterivARB()

GLSL Keywords:  varying, uniform, sampler2DShadow, gl_ModelViewMatrix, gl_Vertex, gl_TextureMatrix, gl_FrontColor, gl_Color, gl_Position, gl_FragColor, ftransform(), shadow2D(), clamp()


 
 
 


 Purchase Product
 C Tutorials
 C++ Tutorials
 C# Tutorials
 Java Tutorials
 Win32 Tutorials
 Direct3D Tutorials
 OpenGL Tutorials
 Recent Tutorials
 Free Tutorials



Get All 350+ Tutorials Now!


                                                              Main  |  FAQ  |  Terms of Use  |  Links Contacts Forums