Shadow Mapping and wrapping problem

Started by
1 comment, last by carew 14 years, 10 months ago
Hi, I have problem with my shadow mapping. All work ok, but I have one problem. I use shadow only for player (good quality). How can I disable shadow texture wrapping on area which are not visible by light? How can I manualy control range of shadow on X and Y axis - UV for texture projection? Thanks for help. [Edited by - carew on May 30, 2009 5:59:12 PM]
Advertisement
If you use shadow maps, than look for sampler adressing mode.
In hlsl you can set adressing mode of your shadow sampler like this:
AddressU = clamp;
AddressV = clamp;
or like this:
AddressU = border;
AddressV = border;
BorderColor = float4(5000.f, 5000.f, 5000.f, 5000.f);
The last one will return a 5000 if you try to sample texture outside 0..1 range.
Very thanks :)

This topic is closed to new replies.

Advertisement