Need help with displacement on layered landscapematerials

I used this solution to ensure displacement only goes where it should.