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 ?