{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

shadow Map steps - Steps for Hardware Shadow Mapping Using...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Steps for Hardware Shadow Mapping Using OpenGL 1. Create an empty depth texture 2. Set it up with an internal format of GL DEPTH COMPONENT 3. Set the GL DEPTH TEXTURE MODE to GL LUMINANCE (so it stores the depth internally with a single luminance value) 4. Enable the depth buffer 5. Render scene from the light 6. Copy the depth buffer into the texture using glCopyTexImage2D(...) 7. (Optional) Display texture to check that everything so far has worked 8. When we project the shadow map onto the scene, we need to compare the texture with the distance to the light we’ll compute at each pixel. Tell OpenGL how to do this comparison by setting (using glTexEnvi(...)) the parameter GL TEXTURE COMPARE FUNC to GL LEQUAL. 9. Tell OpenGL what we want to compare on a per-pixel basis. Set GL TEXTURE COMPARE MODE to GL COMPARE R TO TEXTURE. 10. Tell OpenGL what sort of texture generation to use: glTexGeni( GL S, GL TEX GEN MODE, GL EYE LINEAR ); glTexGeni( GL T, GL TEX GEN MODE, GL EYE LINEAR ); glTexGeni( GL R, GL TEX GEN MODE, GL
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern