For mountain biking, you should at minimum wear MTB knee pads. They provide crucial protection on and around the knee and extend down to the shin.
Unlike years ago, hard-plastic protection isn't really common. Advancements in materials has allowed more freedom of movement around the knee joint. Better articulation means way more comfort on the bike, especially where a lot of pedalling is required.
They can be worn under MTB pants or with MTB shorts.
Some MTB knee pads use D3O. It's a rate sensitive material that harden on impact then softens to its original state.