eidosmontreal / unreal-vdb

This repo is a non-official Unreal plugin that can read OpenVDB and NanoVDB files in Unreal.
Apache License 2.0
691 stars 109 forks source link

Separate density multiplier for temperature volume #55

Closed TheDistiller closed 1 year ago

TheDistiller commented 1 year ago

Could you add an additional shading parameter to control the density of the temperature volume separate from the density volume? At the moment when I'm using the density multiplier to increase the smoke density of an explosion, the fire is getting very dense and crunched. Thanks!

thilamb commented 1 year ago

I think you’re looking for the « blackbody temperature » and « blackbody intensity » that will give you control on the temperature volume rendering. Let me know how it goes.

TheDistiller commented 1 year ago

Here's an example. At density 10 the flames are looking good but the smoke is barely visible. Increasing the density multiplier to 50 helps to make the smoke more visible, but it also increases the density of the flames which were already dense enough at 10 and are now too crushed at 50.

Explosion_Comp_01

thilamb commented 1 year ago

Adding more density definitely adds more contrast and weight to the smoke in between the flames. Temperature doens't really have a notion of "density", it's just adding radiance to the smoke.

Unless you tell me you know a different and better paper or implementation, I'm afraid this is pretty standard and state of the art for a single scattering renderer. Multiple scattering would help getting more diffusion and get closer to your ideal but it's way too expensive in a realtime context.

I recommend adding a post process bloom to fake that.

TheDistiller commented 1 year ago

Maybe this makes it clearer. In redshift you have the ability to adjust/remap density and emission separately whereas in your material the "density multiplier" value affects both density and emission at the same time.

RS_VolumeShader

TheDistiller commented 1 year ago

This plugin gives amazing results for smoke! For fire, to have finer control over the look, it'd be nice to be able to switch to a color ramp option in addition to the blackbody. Makes it easier to get exactly the look you want as shown in this example in Houdini:

Houdini_Color_Ramp

thilamb commented 1 year ago

Hi thanks and sorry for the delayed answer.

Adding a ramp is definitely doable and a good idea. Right now I'm using Unreal's predefined (and cheap) internal ramp. I'll try to do it next week.

As for your Redshift range/remap, it's not going to help with the issue. In most cases Min stays at 0 which means the remap is simply a multiplication, and that what's already available with the plugin.

TheDistiller commented 1 year ago

Hey, no worries. Thanks for implementing the ramp! About the multiplication, my point has always just been to be able to control the smoke and fire individually rather than "density multiplier" controlling both at the same time. That's all.

davoodkharmanzar commented 1 year ago

i think we needs effective methods ... something like this maybe?? :] https://twitter.com/OverdrawXYZ/status/1608614804851404800

thilamb commented 1 year ago

The color ramp (aka color curve/atlas) is already available in the github repo, and will be available soon in an official release: https://user-images.githubusercontent.com/7030046/210806621-d2cd4ce5-bf3e-4cdc-a19a-d5d649d4c828.mp4

Please refer to the official documentation if you need to know how Curve Atlases work.

thilamb commented 1 year ago

And final recap on the density vs temperature multiplier:

VDB Density values can be controlled (multiplied) with the "Density Multiplier" option. VDB Temperature values can be controlled (multiplied) with the "Blackbody Temperature" option.

I could add a range remap like your Redshift example (it is easy to do) but I don't think it would add much compared to a simple multiplication, considering you probably don't want to mess with the "start range" options. And the plugin is already complicated as it is, I don't want to introduce another difficulty.

To finish, every DCC is different and treats volumetric data differently, but the general rule is:

The new color ramp works only if temperature values are between 0 and 1 (like they should). To help control the curve I've added a "Temperature multiplier" to help rescale values in an artist-friendly way. It is the exact same multiplication as "blackbody temperature" but because one is physically based and the other isn't their ranges are way different, and I thought it would be much easier to understand and work with.

thilamb commented 1 year ago

Available with the latest release.

I'll close this issue but feel free to re-open it if you are not satisfied (or open another issue).

Thanks for your feedback !