   Rendering bubbles with fluid
  HiI want to render bubbles within fluid(3D). I already made the simulationand rendered fluid using a simple ray marching code. But I can not incorporaterendering of bubbles as I am not good at rendering.For rendering fluid, I rendered the fluid density. Bubbles are representedby spheres. Would anyone please suggest me?Is there any API available for this type of rendering?   
two options:Cheat Option:Render fluid & bubbles separately and combine images.Use some fog in bubbles for better matching.Realistic simulation option:In ray marching calculate inderect light by shoting rays in eachray march step distributed in spherical form (64+ rays gets good coverage).Inderect light rays are neaded for transparent shadows of bubbles & caustics.Put bubble spheres to spatial data structure (looseOctree).and test all ray marching rays against bubble hits.If there is hit, ray march reflection & refraction rays.(for better outlook simulate dispersion of different wavelengths by shoting multible reflection & refraction rays)(sphere is easy shape so start point of reflection & refractionis easy to calculate)Use monte carlo algorithm to kill secondary raymarching rays.Get some calsulation time for the Earth Simulator computer./TyrianPs. I`d go with cheating.;  Many thanks for your reply.I also want to go with the first option. But how shouldI combine images? Using software? Then I think thatit will be pretty much time consuming to combine a number of imagesas I am saving many frames for the simulation.What is your opinion?The second option is very difficult for me as I am a beginner atrendering.   ;  used / old versions of compositing softwares are not that expensive,there might be allso opensource / free programs.http://www.apple.com/shake/http://www.escapestudios.com/en_GB/technology/compositing/fusion.htmlhttp://www.thefoundry.co.uk/For little jobs max. 20000 frames you can use photoshop with scripts or similarphoto editing softwares supporting scripting./TyrianPs. it`s not that time consuming. (0.1-5.0sec / frame is normal speed)Pss. bbs codes list is well hidden in this forum...   ;  Ok, got it. Thank you very much.   ;  Note that ray marching tends to be several times more expensive than a simple alpha blend operation. The point is, since you're already using an expensive algorithm to generate images, the combining operation takes minuscule amounts of time by comparison.   