I am working on a geometric wrapper for a space jet exhaust impingement solver. A key part of the solution is determining what the jet can "see" and therefore hit. My model is grouped with nodes or grids arranged in 3 or 4 sided elements which are further grouped into bodies. Shading for bodies is handled via outward facing normals and runs very fast, ie backside detection. Shading body to body is currently done by projecting all visible points to the plane of an element and shading the points contained inside the outline of that element provided the z value is greater than the distance to the element. This operation is slow.
My current benchmark is processing only about 3000 elements per second. I know there must be terrible inefficiencies in my code but I feel like this is because of poor approach. I basically check each point until it either is shaded or I run out of elements so it's visible. Loop within loop and another looping check for self-shadowing.
I have looked into 3D Convex Hull and Direct Visibility of Point Sets. Also I looked into Hidden Point Removal. As expected most of the discussion is about 3D rendered applications. I do not have this. All the information is being processed by the CPU and never rendered.
I need suggestions for ways to effectively build/approach such a shader. What things work well, what things to avoid. I do not have access to graphics hardware on the machines that will run the final solution. If it matters I am currently working in C/C++ on Linux systems.