I have a line of sight system that I’m trying to optimize, currently the player fires out multiple line traces in a 360 degree angle to form a circle, the line trace then draws on a texture that I use in my post process to visualize the line of sight for the character.
this works fine for me but it is pretty expensive as it has to fire a ton of traces every tick.
There are systems I’ve seen online that have a edge detection algorithm for the line trace that eliminates the need for so many traces and fires out the ones that are essential.
[Example][1]
I’ve also seen some documentation online about this but its all in code and I only know blueprint.
[Documentation 1][2]
[Documentation 2][3]
The second article states that the algorithm is
1.Calculate the angles where walls begin or end.
2.Cast a ray from the center along each angle.
3.Fill in the triangles generated by those rays.
The code I currently have from [this tutorial][4]
What I have currently
What I would like to achieve.
I know this is probably a lot to ask for but any help to put me in the right direction would be appreciated thank you!