caewok / fvtt-elevated-vision

Adjust Foundry VTT vision, lighting, and token elevations based on terrain, wall, or token elevation.
MIT License
12 stars 5 forks source link

Vision glitch for terrain walls #95

Open rapus95 opened 8 months ago

rapus95 commented 8 months ago

I guess you would have to special case endpoints so you don't count them as 2 walls. Otherwise the following happens: image

caewok commented 6 months ago

I actually do special case endpoints, but it clearly needs work!

caewok commented 6 months ago

I am not sure yet how to fix the issue, but if you set the "Light Size" in the light configuration to 0, it will temporarily fix it.

The issue is that when the light is not a point source, but rather has a size, the two sides of the light make a triangular shadow at the endpoint. That would not be an issue, except that because the walls are connected, there are (from the point of the view of the shader) two shadows—one from the first wall at its endpoint and the second from the second wall at the same overlapping endpoint. These shadows are then interpreted as the shadows from two distinct terrain walls (because they technically are) and the overlap is considered a real shadow at that point.

I need to figure out if I can trick it or otherwise add additional special handling for connected terrain walls like this.