Search - User list
Full Version: Rectangular spotlight
Root » Technical Discussion » Rectangular spotlight
eetu
I would like to make a ‘shadowmapped point light’ with six 90deg spotlights.

I'm at a loss how to make a spotlight cast a rectangle instead of the usual circular mask. An all-white projection map doesn't do the trick, and i can't find any relevant rendering param either.

I guess I could make a small rectangular projection map that fits inside the spot circle and make the spot so wide that the small rectangle fits the 90deg projection angle. Of course the shadow map projection angle would need to be decoupled and adjusted appropriately.

With a little bit of math it should all line up, but I'm wondering if there is some way of getting rid of the default circular mask.
symek
Hey eetu!
Circular mask is made inside ASAD light shader with this:

float
getConeCoverage(vector LL; float cmin, cmax, croll)

If you apply your own asad shader and toggle off “cone lighting”, you will have rectangular shadows. Note that this is actually the only difference between point and spot light, so you can do your shadow casters with point lights either .

Nice idea is to build a cubic shadows with soho. This way you don't clatter your scenes with x6 items for each light. Also in-between maps filtering can be handled in a single shadow shader.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB