Announcement

Collapse
No announcement yet.

Volumetric Fog feedback thread

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • started a topic Volumetric Fog feedback thread

    Volumetric Fog feedback thread

    Starting this thread for feedback and discussion about the new 4.16 Volumetric Fog feature.







    Full feature description:

    We now have support for Volumetric Fog. This method computes participating media density and lighting at every point in the camera frustum, so we can support varying densities and any number of lights affecting the fog.

    Click image for larger version

Name:	0OriginSmaller.jpg
Views:	1
Size:	191.3 KB
ID:	1217183

    Lighting

    Volumetric Fog supports lighting from:
    * A single Directional Light, with shadowing from Cascaded Shadow Maps or static shadowing, with a Light Function
    * Any number of point and spot lights, with dynamic or static shadowing if 'Cast Volumetric Shadow' is enabled.
    * A single skylight, with shadowing from Distance Field Ambient Occlusion if enabled
    * Particle lights, if 'Volumetric Scattering Intensity' is greater than 0

    Not currently supported:
    * Precomputed global illumination
    * Shadowing of Stationary skylights
    * IES profiles and Light Functions on point and spot lights
    * Shadowing from Ray Traced Distance Field Shadows
    * Shadowing from the volumetric fog itself

    Translucency is properly affected by Volumetric Fog, depending on its position in the scene. By default translucency computes fog at vertices, so water planes with low tessellation can introduce artifacts. These materials can be set to compute fogging per-pixel to solve this with 'Compute Fog Per Pixel'.






    Global controls

    Volumetric Fog controls are on the Exponential Height Fog Component. The exponential height distribution provides a global density for Volumetric Fog.



    Scattering Distribution determines how directional the volumetric scattering is - a value of 0 means light scatters equally in all directions, while a value close to 1 causes scattering predominantly in the direction of the light (you have to be looking at the light to see its scattering).

    Albedo is the overall reflectiveness of the participating media. Clouds, fog and mist, which are based on water particles, have an Albedo close to 1.

    Extinction scale controls how much the participating media blocks light.

    View Distance is the distance from the camera over which Volumetric Fog will be computed. There are a limited number of Z slices in the volume texture, so pushing out the View Distance will increase under-sampling artifacts near the camera.

    Note that Volumetric Fog can't really match the Exponential Height Fog in the distance, as Volumetric Fog is physically based while Exponential Height Fog is not. Properties like StartDistance, FogMaxOpacity and FogCutoffDistance don't affect Volumetric Fog.

    Each light has a 'Volumetric Scattering Intensity' and 'Cast Volumetric Shadow' setting.


    Local controls

    Materials using the new Volume Domain describe Albedo, Emissive and Extinction for a given point in space. Albedo is in the range [0-1] while Emissive and Extinction are world space densities with any value greater than 0.

    Volume materials currently only work on particles, and only positions inside the particle radius are valid, which is usually handled by a SphereMask. The simplest Volume material for a particle system looks like this:

    Click image for larger version

Name:	MaterialSmaller.jpg
Views:	1
Size:	116.1 KB
ID:	1217184

    Placing a single-particle system with that material causes a sphere of density to be added to the Volumetric Fog. The effect is fully 3d with no billboards involved.

    Click image for larger version

Name:	SingleParticleSmaller.jpg
Views:	1
Size:	122.4 KB
ID:	1217186

    Multiple spherical fog particles with noise from textures can be used to limit fog to a certain area.


    Temporal Reprojection

    The volume textures used by Volumetric Fog are relatively low resolution and aligned to the camera frustum. Volumetric Fog uses a heavy temporal reprojection filter with a different sub-voxel jitter each frame to smooth out the aliasing. As a side effect, fast changing lights like flashlights and muzzle flashes leave lighting trails. Disable volumetric fog contribution on these lights with 'Volumetric Scattering Intensity' set to 0.


    Performance

    The GPU cost of Volumetric Fog is primarily controlled by the volume texture resolution, which is set from the Engine Shadow Scalability level. Volumetric fog costs 1ms on PlayStation 4 at High settings, and 3ms on an Nvidia 970 GTX on Epic settings, which has 8x more voxels to operate on.

    Particles using the Volume domain can add significant GPU cost, depending on their 3d overdraw and instruction count. Use 'profilegpu' to inspect this cost.

    Point and Spot lights which have 'Cast Volumetric Shadow' enabled cost ~3x more than unshadowed Point and Spot lights.

  • replied
    I didnĀ“t find any discussion about theatrical lighting, sorry if there is some.

    But my question is:
    Is there anyway to make volumetric lights with gobos like in this picture?
    I already try in lightfunction material and it works in objects and surface. but not in the air.



    Click image for larger version

Name:	Gobo1.jpg
Views:	1
Size:	166.3 KB
ID:	1653318

    Leave a comment:


  • replied
    There seems to be a bug when using world position in a light function in combination with volumetric fog. Notice in the attached images the incorrect masking of the volumetrics. The expected result would be that only the volumetrics below the cube surface are darkened similar to the sides of the cube. The issue is also camera relative, so this masking flies around the scene depending on the camera angle making this combination of features unusable.

    To make matters worse there doesn't seem to be a way of disabling the light function just for the volume fog effect. In my usecase (and I imagine for others as well) I wouldn't need that anyway so it seem like a useful optimization to offer that option.

    Edit: I submitted a bug report with an example project here on answerhub.
    Attached Files
    Last edited by Arnage; 08-15-2019, 06:44 AM.

    Leave a comment:


  • replied
    Originally posted by Tisanim View Post
    When using console coomands

    r.VolumetricFog.GridPixelSize

    r.VolumetricFog.GridSizeZ

    Are they saved with the level?
    Also what are the default values of the commands mentioned above?

    Thanks!
    The values are not saved in the level. You have two choices:
    - use an execute command inside level blueprint and set them
    - set the variables inside the project's engine.ini

    The default values are the one you receive as return once you type at the console the variable names without specifying a value to change them.

    Leave a comment:


  • replied
    When using console coomands

    r.VolumetricFog.GridPixelSize

    r.VolumetricFog.GridSizeZ

    Are they saved with the level?
    Also what are the default values of the commands mentioned above?

    Thanks!

    Leave a comment:


  • replied
    OK, thanks, i will do it...

    Leave a comment:


  • replied
    Originally posted by Citymmer View Post
    Volumetric fog and DOF seam to create artefacts with translucent material..The Material: Details panel > Translucency unclick Enable Separate Translucency.doesn't work well, even for a volumetric fog (with transclucent material) ...Where we can find very special but interesting artefacts here: (https://www.youtube.com/watch?v=36Qoq_kB9jk)
    It is very important if you could create a small repro project (basically stripping most of the content and using replacements props) and send it using the Bug Submission Form using this link

    That is the better way to make the developers aware of the issue.

    Leave a comment:


  • replied
    Volumetric fog and DOF seam to create artefacts with translucent material..The Material: Details panel > Translucency unclick Enable Separate Translucency.doesn't work well, even for a volumetric fog (with transclucent material) ...Where we can find very special but interesting artefacts here: (https://www.youtube.com/watch?v=36Qoq_kB9jk)

    Leave a comment:


  • replied
    Originally posted by rosegoldslugs View Post
    Even if that was supported, you wouldn't really get much back. You'd be stretching the volume texture reeeaaallly far and would lose any/all definition from shadow casters. Only use case of volumetric draw distance of 100,000,000 that I can think of is a planetary-scale game, which UE4 doesn't really support out of the box anyway so you'd likely be looking at a custom solution.
    The problem is that you can use the volumetric fog to simulate sun rays trough the clouds. It works perfectly but only in really small scales. There isnt a reason why this shoudnt work on a real scale since the resolution of the shadows and the volumetric fog still the same. Also the draw distance of 100,000,000 is just as an example in an empty scene, unfortunately it breaks much earlier in a standard game scene with lots of assets.

    Leave a comment:


  • replied
    Even if that was supported, you wouldn't really get much back. You'd be stretching the volume texture reeeaaallly far and would lose any/all definition from shadow casters. Only use case of volumetric draw distance of 100,000,000 that I can think of is a planetary-scale game, which UE4 doesn't really support out of the box anyway so you'd likely be looking at a custom solution.

    Leave a comment:


  • replied
    Originally posted by II_ADN_II View Post
    Hi, dont know if it was said before, but increasing fog distance crash the volumetric fog when the camera moves and the screen end up completely black. this doesnt happen in small scales. Shouldnt the fog be able to work as expected despite the scale? Is this a bug? Any solutions?




    PD: is there any plan to make the light functions work with the volumetric fog?
    PD2: It actually work with directional, not with point or other type, have to use the texCoord instead WorldPosition to map the function
    Bumping for help

    Leave a comment:


  • replied
    Bump, any workaround or solution?

    Leave a comment:


  • replied
    Hi, dont know if it was said before, but increasing fog distance crash the volumetric fog when the camera moves and the screen end up completely black. this doesnt happen in small scales. Shouldnt the fog be able to work as expected despite the scale? Is this a bug? Any solutions?




    PD: is there any plan to make the light functions work with the volumetric fog?
    PD2: It actually work with directional, not with point or other type, have to use the texCoord instead WorldPosition to map the function
    Attached Files
    Last edited by II_ADN_II; 06-05-2019, 02:47 PM.

    Leave a comment:


  • replied
    misterbil augminded I had this problem too. Turns out vol. fog has issues with instanced stereo rendering; I turned that off and how I have proper fog in my VR project.

    Leave a comment:


  • replied
    My scene has a room with open doors. Does anyone know how UE4 removes the high fog in the room?[/COLOR]
    [/COLOR]
    Last edited by JanyYZ; 05-23-2019, 02:00 AM.

    Leave a comment:

Working...
X