javascript - How it is possible to get rid of spurious artifacts of Shadow Mapping? -
spurious artifacts in case of creation of shadows through shadow mapping.
i can't understand why many shadows drawn, , originate? example: example
it looks shadow map covering fraction of scene, , being tiled (repeated) cover rest. change wrapping mode shadow map gl_clamp_to_border
:
gltexparameteri(gl_texture_2d, gl_texture_wrap_s, gl_clamp_to_border); gltexparameteri(gl_texture_2d, gl_texture_wrap_t, gl_clamp_to_border);
and set border color 1.0f
or 0.0f
, depending on whether want things outside shadow map lit or unlit:
glfloat bordercolor[] = { 1.0f, 1.0f, 1.0f, 1.0f }; gltexparameterfv(gl_texture_2d, gl_texture_border_color, bordercolor);
Comments
Post a Comment