Some questions about the density field and rendering.

87 views
Skip to first unread message

WH

unread,
Jun 7, 2018, 12:38:25 AM6/7/18
to mantaflow Forum
hi!
I am a student studying on fluid simulation in computer graphics. And I found this framework which has been used as a basis for some papers. 

To get better visual effect, I use mantaflow to output the density field for rendering. But I found some strange points.

1. negative value
There are some negative value in the density field which should be impossible because I use the Maccormack method for advection where the "MacCormackClamp()" function should correct the wrong value caused by "MacCormackCorrect()" function.
I wonder that is that a mistake or something?

2. unnatural result in rendering
By the way, I modified the code to save density field as the ".pbrt" format. Then I rendered it with pbrt, and some results look strange.
First I use the ./scene/simpleplume.py for simulation, and the result image looks clear:

high resolution(256)                   low resolution(64)


Then I use "source.applyToGrid( grid=density , value=1. )" to generate smoke, the result then looks strange:

high resolution (256)(with sphere obs)                          low resolution (64)



I think that's because of some negative value in density field.
So I wonder how to get the rendering image like the result image in the papers?

I'd hugely appreciate any help! :)



Nils Thuerey

unread,
Jun 8, 2018, 4:10:42 PM6/8/18
to mantaflow Forum
Hello, the renderings look nice! But you're right, due to the MacCormack clamping, there shouldn't be any negative values, unless you initialize them somewhere manually. Are you using one of the standard scenes? In the renderings, MacCormack can sometimes produce "hanging" densities from overly strong sharpening. You can either try "clampMode=2" in advectSemiLagrange, which is a bit less aggressive, or otherwise slightly dissipate the densities by subbtracing a small value for every time step (then you need to make sure you don't get values <0 though).

WH

unread,
Jun 12, 2018, 10:03:19 AM6/12/18
to mantaflow Forum
Thanks for your reply! The opinion on the "hanging" densities really inspired me. 

For simulation, I simply use the "source.applyToGrid( grid=density , value=1. )" in ./scene/plume_adaptDt.py instead of "densityInflow(...)", because I don't want to add much noise in the smoke.
I don't know if I can use the "densityInflow(...)" without adding any noise to the smoke column. Maybe that's the reason. I will read the source code later to check it.

Thanks for your reply again! :)

在 2018年6月9日星期六 UTC+8上午4:10:42,Nils Thuerey写道:
Reply all
Reply to author
Forward
0 new messages