These calculations are generally done by shaders (which are outlined by texture artists). A shader for glass, as an example, considers what elements are rendered behind the glass. Then only tints that color to look like https://deaconrjux849774.wikiusnews.com/850684/3d_animation_for_dummies