x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Volumetric fog and DistanceToNearestSurface

Hello,

I have an actor called Clouds. This is a collection of sphere meshes with a "cloud" material applied. The cloud material is a Masked material that uses DistanceToNearestSurface in order to cut shapes into the clouds (part of my gameplay is having players fall through clouds and leave imprints).

The problem that I'm having is regarding the new Volumetric Fog feature in 4.16. I have an IF inside the cloud material which determines the opacity mask (if something is touching the cloud, it will have a 0 opacity in that location). This opacity mask technique works well BUT it does not seem to work correctly with Volumetric Fog. If I hard set the opacity mask to be 1, then the fog behaves correctly with the clouds, and I get nice shafts of light playing around the shapes of the opaque (1) clouds. However, if I use the IF statement, which takes the DistanceToNearestSurface node as input, though it appears to be fully opaque in the editor, the volumetric fog is not interacting correctly (i.e. ignores the clouds).

Something to note, inside the blueprint editor, when I have my Cloud material applied to this collection of spheres, they are completely invisible (viewport). When I drag the actor into the scene, however, they are correctly opaque in the right areas. I suspect that this could be related to the root of the issue with the volumetric fog ignoring the clouds despite their appearing correctly in the editor.

My end goal is to be able to have the volumetric fog "light rays" be shining up against the clouds, as well as through the holes that players leave behind as they fall through the clouds. I've tested a non-uniform opacity mask texture, and it behaves correctly so I don't think the problem is with masked materials and volumetric fog. I think the issue is much deeper and something about UE4 rendering that I don't understand, perhaps the order in which things are resolved.

Any help or insight is greatly appreciated :)

EDIT: By checking Dither Opacity Mask in the material details, I was able to correctly use a the masked cloud material and have it interact with the volumetric fog/lighting. However, I haven't been able to get the light to go THROUGH the masked areas (0 opacity). I tried using the DitherTemporalAA node in conjunction with this but that didn't work either.

Product Version: UE 4.16
Tags:
more ▼

asked Jun 07 '17 at 08:01 PM in Rendering

avatar image

Shempii
86 5 8 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question