Taking into account material when tracing