eidosmontreal / unreal-vdb

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

BP_VdbToVolumetricClouds #48

Closed Andrej730 closed 1 year ago

Andrej730 commented 1 year ago

Is there some description for BP_VdbToVolumetricClouds - how it works and how to set it up?

Found it in the LVL_VDB_Sequencer that goes with SparseVolumetrics_ue5.1_0.6.2_with_data. It's not mentioned anywhere but it seems like a great solution for #39 - it does look good on render and it has good sorting and it's blending well in the level! It seems like a good way to add some well blended vdb smokes in the scene.

And is there any way to add temperature to it or to fake it somehow?

image

thilamb commented 1 year ago

Hello,

There is no documentation on this blueprint but hopefully the provided exemple levels are self-explanatory.

This technique uses VDB to Volume texture, which can then be used anywhere you want in Unreal. I use with Unreal’s volumetric clouds (and also with some custom hlsl material in another level). Unreal volumetric clouds work great in general. But I’m not sure it’s going to solve all transparency issues (I don’t think it writes depth).

I wrote a very quick FAQ that helps you adding more clouds if you want: https://github.com/eidosmontreal/unreal-vdb/blob/main/HELPME.md#faq

There is no way to add temperature though. You can try faking it in the material.

Andrej730 commented 1 year ago

Have you met some example where someone managed to configure volumetric cloud + vdb to look good at really close distance? There is example that goes with plugin but the cloud-vdb is very far away and there is no need for the detail quality and sampling.

The main issue I have right it's still a bit noisy at the edges. image

thilamb commented 1 year ago

You would have to dabble with all the console variables associated to volumetric clouds to get your desired look.

The one I found that really helped a while ago was r.VolumetricCloud.DistanceToSampleMaxCount. There may be others.

Andrej730 commented 1 year ago

You would have to dabble with all the console variables associated to volumetric clouds to get your desired look.

The one I found that really helped a while ago was r.VolumetricCloud.DistanceToSampleMaxCount. There may be others.

Already tried all available settings.

Andrej730 commented 1 year ago

Want to share some results investigating volumetric cloud

1) It does work better with volume materials (solves #39). Left cube is behind the VDB, right one is in front. You can even see that Volumetric Scattering Intensity works too (I've left the gizmo for the point light with VSI). UnrealEditor_4caGld4Cir

  1. Doesn't solve issues with translucent material - they are exactly the same as for VDB. Translucent in front looks fine, translucent behind has sorting issues and drawn over vdb.

UnrealEditor_HU6KSUY5UG

  1. Groom has the same issues as translucent, the same way as it works in VDB (#32). image
thilamb commented 1 year ago

Thanks for the update !

Are you showing three "clouds" in the first image ? Or are you mixing one volumetric cloud + 2 VdbMaterialActors ?

If it's the first case, it will work for sure as it should also work with 3 VdbMaterialActors (they are sorted from camera distance).

I'm not surprised with points 2. and 3. . I've even taken more time to investigate hair strands, and also noticed they have the same issue with transparent objects behind. They do write depth which helps sometimes but breaks some other times. I have a local branch trying to fix this but I'm not happy with the results yet. I've tried stochastic transparency and stochastic depth but TAA doesn't converge towards a good solution enough.

Andrej730 commented 1 year ago

Are you showing three "clouds" in the first image ? Or are you mixing one volumetric cloud + 2 VdbMaterialActors ?

The cloud is volumetric cloud that's using volume texture from VDB. Cubes are static meshes with volume material.

Andrej730 commented 1 year ago

I think I've found a solution for translucent materials (thanks to advice from Asher Zhu).

The solution is to use "Apply Cloud Fogging" is the settings of translucent material.

image

Without fogging:

UnrealEditor_Y8OCaFizeK

With fogging: UnrealEditor_bZGrGOkryI

So the only current problem with VDB clouds (besides not having temperature) is sorting with groom sorting. Also tried to use r.HairStrands.ComposeAfterTranslucency 0/1/2/3 to fix the groom problem but it didn't worked.

thilamb commented 1 year ago

Excellent, thanks for sharing the solution !