How to make navmesh agent avoid certain materials in the landscape?

I am developing a top-down click-to-destination game. I know that I can put modifier volumes, etc. However, I would like to make the landscapes procedurally generated. So, I want the navmesh agent to follow whatever path is generated.

I have an idea of how to solve it, however, I am unsure if I am reinventing the wheel.

My solution would be to check for interceptions along the path and query the material, then use the location that is of the right material as a waypoint for the navmesh agent to move to. Then, repeat till the navmesh agent is near enough to the destination.

I also saw people using splines and modifier volumes. But, I feel that all those solutions will need either set landscapes. I guess I could create spline points based on checking the materials of the waypoints along the route.

Am I on the right track?

Thanks!