Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: variance shadow mapping and mipmapping

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    24

    variance shadow mapping and mipmapping

    I implemented a variance shadow mapping. I store a linear depth and linear depth ^ 2 in the color texture. Next a gaussian blur is applied to that texture. It consist of two passes, so two additional
    textures are required:
    - first texture storing result of the vertical blur
    - second texture storing result of the final blur (vertical + horizontal) and is sampled in a shader

    I use mipmapping, the above textures have set appropriate min filter:

    - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);

    In the rendering loop glGenerateMipmap is called. Generally a variance shadow mapping works fine but I get some artifacts when I use mipmapping for the texture which stores the final blur and is sampled in the shader (mipmapping using with the linear depth texture and the vertical blur texture doesn't cause any artifacts)

    Why I get these artifacts ? Here is screen

    I also wonder if I should use mipmapping for all three texture. Does it make sense ?

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,188
    Whenever you see screen-space tangent surfaces, you have large texcoord derivatives and therefore are typically sampling very high up in the MIPmap chain (smallest levels -- i.e. the most downsampled). Consider the effects of that.

    For instance:

    * Screenspace vs. Mip-mapping (Pranckevičius)

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    24
    So what is the conclusion ? In all articles about VSM which I have read was information that using mipmapping, anisotropic filtering and gaussian blur with VSM can improve quality of the soft shadows. Finally I set parameters for textures this way:
    - (linear depth, linear depth ^ 2) mipmapping + anisotropic filtering
    - (vertical blur) anisotropic filtering ( using mipmaps when reading a vertical blur texture doesn't cause any artifacts but I have doubts if it make sense).
    - (final blur) anisotropic filtering

    What do you think about that ?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •