moved visibility function to shadermanager class