Page MenuHome

Smoke/volume visualization settings
ClosedPublic

Authored by Kévin Dietrich (kevindietrich) on Jan 12 2016, 9:28 PM.

Details

Summary
NOTE: This is not really ready for code review, just uploading this here for general feedback on tools, what's desired or not, what else could be done, etc..

This introduces a number of "tools" to visualize a smoke sim in different ways.

Included changes are:

  • Object (axis) aligned slicing.
  • Single slice visualization.
  • Transfer function based on a color ramp.
  • Control of the apparent thickness of the volume.
  • Visualize the velocity field as a set of needles or streamlines

The overall number of slices can be set on a "per voxel" (smoke resolution) basis, meaning that if the resolution is set to 32, there will be slice_per_voxel * 32 slices in total.

Diff Detail

Repository
rB Blender

Event Timeline

Here are a couple of screenshots:

  • Add a function to compute volume normal.
  • Rework UI a bit.
  • Add automatic axis detection for single slice mode.
  • Make sure display thickness is always initialized.
  • Add a function to compute volume normal.
  • Rework UI a bit.
  • Add automatic axis detection for single slice mode.
  • Make sure display thickness is always initialized.
  • Add support to draw the velocity field as needles.
  • De-duplicate logic behing transfer function creation.
  • Add support to draw velocity vector as needles.

Hi Kevin, just came back from business trip - will now test it. Could you lift line 390 to 389 (rna_smoke.c) next time you update the patch? The #endif is one line too low...

Will report back once I tested a bit..

Oops, wonder how that got in... will quickly update the patch, just in case.

@Thomas Beck (plasmasolutions), @Gottfried Hofmann (gottfried), do you guys have any comment on the (basic) functionalities introduced here? I'm particularly concerned about the color ramp thing, since it interfere with fire rendering. Otherwise, I'll try to find some core developers willing to review the code.

Hi @Kévin Dietrich (kevindietrich),

this is definitely useful! Not only to visualize smoke (& its behaviour) in the viewport better but also because we render smoke oftentimes in the viewport and composit it over footage. The different visualization options are very helpful in this regard. Especially the "Axis / Single / Position" option is awesome for 2D scenes. What I didn't get yet was how to control the color ramp though. I could only make some single colored smoke (with various alpha values but no different colors)... will try to contact you in IRC - maybe it's just a dumb user error..

The draw velocity options were not used that much up until now in my studio - but maybe when we have errors in the simulation that we can't track they come in handy (btw. the hard limit of 10 was way too less in almost all of our simulations).

So all in all a definite YES for these features (except the - it's really great!

I did not find time yet to apply the patch myself - in what way does the patch interfere with fire rendering?

Colorramp is useful but not easy to use. Here, it controls two things.
It gives colors accordding to density and acts as a density multiplier according to alpha values.
Problem is that when you change position of a stop to change color, alpha value position used as a density multiplier is changed too.

Probably, it would be better to have a custom curve widget for density like in freestyle linestyle alpha modifiers and have no effect from alpha values of ramp.
Sometimes, I think that a levels of grey ramp widget would be more adapted than curve widget.

Use of color ramp implies a rendering based on density.
If colors can be decoupled from density, is it possible to have menu to tweak color according to another smoke attribute like heat ?
I am not requesting several color tweakings that would be mixed on final display.
I am just saying that (except velocity that have a great line display), each attribute could benefit of a study through colors.

Smoke color is default display but it is not tweakable, too. We can't try to reduce it or push it in viewport. It is thomas problem about several flows.
Could it be possible to have a Hue Correct widget for this one ?

This patch kinda rot, but I'm not given up on it ;)

I just set the hard limit of some properties to 1000.0 instead of 10.0 (hopefully that's enought) and I also added access to the various fluid fields:

Also updated against latest head.

Kévin Dietrich (kevindietrich) edited edge metadata.
  • Merge branch 'master' into smoke_vis_tools
  • Cleanup: avoid using sets.
  • Fix compile error.
  • Cleanup.
  • Expose all fluid fields to the UI.
  • Fix drawing of the transfer texture.
  • Rework default values, UI/props ranges.
  • Add some tooltips, remove some fields in the UI.
  • Revert a few changes from master.
  • Remove compute_normals from shader.
  • Use more sane variable names.
  • Cleanup.
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.

Note that I haven't committed the color ramp part of the patch since I'm a little hesitating about its usefulness, though I can still commit it as is if people really want it.

Since viewport is maintained in these days, I hope color-ramp would be one of the great features for better vusializations and rendering smoke directly from viewport.

I committed the ability to use a color ramp for rendering. Note that it turns off fire rendering.