# Representing smoke density in a grid.

This topic is 2747 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all,

So far I've been working on my own implementation of smoke simulator based on the seminal paper of Jos Stam's "Stable Fluids". I understand all the numerical simulation methods discussed in the paper. However one thing bothering me is that in the paper, it is not mentioned about how to represent the smoke's initial density in a 3D grid structure. If you can enlighthen me on this subject, I'll be really glad.

##### Share on other sites
See "Real-Time Fluid Dynamics for Games" by Stam

http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf

There is an accompanying source code on his website.

Oh.... Also, nice anti-solipsistic sig.

##### Share on other sites
Hidden
Oh.... Also, nice anti-solipsistic sig.

I've already looked Stam's code. It was written for a 2D grid and it links density injection to the user input via mouse clicks. What I want to do is to inject density sources in a 3D grid. In GPU Gems-3, it mentions that Gaussian splats for the density source. But I am not sure of it.

##### Share on other sites
Sorry about that. You've seen these?

http://http.develope...ugems_ch39.html

http://prideout.net/blog/?p=60

"Texture Splats for 3D Scalar and Vector Field Visualization" by Crawfis, Max.

It seems that when these papers talk about Gaussian or quadratic or whatever functions, they're referring to the opacity falloff of the splat with regard to radial distance from the centre of the splat. As for how they use this to inject smoke, I am also at a loss as to what they're referring to. Sorry. Perhaps they're just obtaining the density field from splats (instead of the other way around, like you normally would do when rendering). Perhaps if you wrote to the authors, they could explain it a little.

FWIW, I just used a ray marching technique for my "smoke" because I was lazy. This is what I was inspired by: http://users.cms.cal...ject_fluid.html (I'm sure that you recognize the author). The hardest part was determining ray-box collision. In other words, texture splatting is not the only way to go.

Wish I could have helped you more.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 10
• 18
• 13
• 9
• 9