The present invention relates to a light field light source orientation method for augmented reality and virtual reality and a front-end device. The method comprises: A: identifying a target marker; B. tracking the target marker; C. analyzing the pixel color shape on the marker object; D. analyzing color difference zones on the marker object and analyzing the shape cast to calculate direction of environmental light source; E. pushing the light source directional data to an augmented reality object; and F. compensating and adjusting the imaging of an augmented reality object: the present invention can collect surrounding environmental factors, such as the light source direction, so as to project a computer-generated object into a reality environment to possess a shadow consistent with that in the reality, so that an augmented reality environment is more realistic and represents a realist shadow effect of the object.
Light field light source orientation method for augmented reality and virtual reality and front-end device