Skip to main content
GameDev.net gamedev.net
🔒 Locked

Rendering bubbles with fluid

Started by udvat May 27, 2009 at 1:27 AM 4 replies 1.3k views
Original Post
udvat
udvat
Hi I want to render bubbles within fluid(3D). I already made the simulation and rendered fluid using a simple ray marching code. But I can not incorporate rendering of bubbles as I am not good at rendering. For rendering fluid, I rendered the fluid density. Bubbles are represented by spheres. Would anyone please suggest me? Is there any API available for this type of rendering?
TyrianFin
TyrianFin

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 each
ray 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 & refraction
is easy to calculate)

Use monte carlo algorithm to kill secondary raymarching rays.

Get some calsulation time for the Earth Simulator computer.

/Tyrian

Ps. I`d go with cheating.
udvat
udvat
Many thanks for your reply.

I also want to go with the first option. But how should
I combine images? Using software? Then I think that
it will be pretty much time consuming to combine a number of images
as 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 at
rendering.
TyrianFin
TyrianFin
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.html
http://www.thefoundry.co.uk/

For little jobs max. 20000 frames you can use photoshop with scripts or similar
photo editing softwares supporting scripting.

/Tyrian

Ps. it`s not that time consuming. (0.1-5.0sec / frame is normal speed)

Pss. bbs codes list is well hidden in this forum...
udvat
udvat
Ok, got it. Thank you very much.
Nik02
Nik02
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.
Niko Suni

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.