Automatic texture mapping

In programs specifically made for making levels for games such as Valve’s ‘Hammer editor’, you can add a brush (a cube/cuboid) which will be automatically textured so that it will have an even texture projected to each side based on the angle of the face. My idea was that it would be possible in Blender using material with nodes, but I’m not very experienced with nodes and haven’t been able to have it work correctly. The idea is that the model should be able to look like it is mapped manually and has the same texture density.

The reason for this is that it is a hassle to UV unwrap a model that uses repeating textures and then have to make sure that each face is aligned and has the same density and doesn’t stretch when I edit the geometry.

My attempt ended not being very warped because I wasn’t sure how to map it evenly on all sides, but this is as close to the result I wanted as I could get, as seen here, but it shows what I am trying to achieve.

My node set up

So, if anybody knows how to achieve this either using nodes or another method, any help would be greatly appreciated.

This is what I am trying to achieve with 1 material:

However this requires 3 materials, and more work because I have to chose which material to use for each face based on direction, which is not a huge problem but It would be a more intuitive and useful material if it required less user input.

What you need is the uv-project modifier:

Example using procedural and image textures

Thank you so much!! This is extremely helpful!