for regular CG lighting it is a lot of vector calculations. i don’t remember the exact specifics but i watched a houdini tutorial where he designed a basic point light shader by taking the dot product of the lights position in space and the objects position in space. the dot product i think being the angle perpendicular to the sum of both vectors? he explained it way better than i could, i’ll have to watch it again sometime for a refresher.
of course for shadows and reflections the basics of raytracing is not hard to grasp. lights shoot rays, it detects where they hit, and from those points rays for secondary bounces are shot, and the rays that pass through become the raytraced shadows. depth map shadows work a bit more like projection mapping which is why they have resolution and not ray count.
ambient occlusion basically detects how close surfaces are relative to each other, and shades them darker if they’re closer and lighter if they’re farther apart. i believe this uses randomly placed raytracing but don’t quote me on that.
image based lighting utilizes GI from luminant surfaces.
for GI its my understanding that most renderers use 1 of 3 methods.
the way i understand it QMC or quasi monte carlo generates random samples and then refines future samples by resampling those samples, assuming light falls off those surfaces uniformly. it basically takes a randomize result and trys to homogenize it which can create repeating patterns… it also can be very noisy without longer render times, though i’m not sure the reason for this. Vray uses a variant of QMC called deterministic monte carlo or DMC, though i’m not sure what they changed.
Stochastic sampling / photon / radiance mapping is a method by which “photons” containing light intensity and color data are shot around the scene and then interpolated, but this is now legacy in comparison to irradiance caching, which basically does the same thing but stores a bunch of distributed points around the scene before hand to speed up render times. Sometimes it relies on ambient occlusion to make denser irradiance points in more detailed areas, which can overall make a smoother better result.
Light caching or light mapping is very similar, but rather than spreading points relative to the lights, it does so relative to the camera, to figure out what is going to be in frame and what is not. it is a very nice trick for speed optimization.
again, there are people that are much more expert at this than me… my understanding is limited to what i need to know to make the software work for me. but it is good to know what is going on in the backend instead of just blindly tweaking it trial and error wise