flockaroo OP t1_ita5lku wrote

the functions are just the ones from school, just many of them summed up and in different scales ;-)

oh, and the foam is actually an illusion. in thin layers (like in the wave crowns) the light gets reflected/refracted multiple times in the same region, which leads to a more random light diffusion in those regions. i was surprised myself by that effect! ...that doesn't mean real waves cannot have foam additionally ;-)


flockaroo OP t1_it8plfl wrote

hmm ok, why not, let me try... its basically "ray tracing/ray marching/path tracing": first i'm defining the glass and the whiskey surfaces as mathematical functions (actually distance appoximation functions). then for each pixel i step from eye position into the direction of the pixel into scene until i hit a surface. on a surface with a certain probability (fresnel equations) the viewing ray gets reflected/refracted from the surface and walks along. this is repeated until the ray hits a light source. and this is then repeated for all pixels and several times util we have a properly lighted scene...