Download

How does Volumetric Fog work with translucent objects?

Hey there

is there any documentation about how Volumetric Fog works with translucent objects? I guess there is a special buffer that translucent objects write there depth in, right? Otherwise the objects would render just on top of each other.
If this is the case, is it possible to access this buffer inside the shader-nodegraph?
I am currently working on custom volumes and want to use as much as possible from existing systems.

Thanks in advance! :slight_smile:

There’s a setting called Translucency Sort Priority (found in the material editor, and in a mesh’s details panel in the main editor). Lower values render an actor behind others with higher priority values. Equal values for two or more actors can have different results, I think.

There’s also Separate Translucency (enable to cause an actor to be unaffected by DOF), and Render After DOF (look that one up in the docs for description). From what I recall, in the context of translucent objects (such as volumetric fog), the rendering is performed from back to front in terms of distance from the camera / view.

@presto423 yes I knew about those settings for translucency, but it seams that translucent objects are neither rendered before nor after the fog. They appear pretty accurate inside the fog.
If you set the sorting priority equal, it sorts it based on the origin of the object, but it will still be only before or after the fog and it will not appear inside the volume.

The problem is, that you have to render the fog before or after translucent objects and then you have to know also the depth of the translucent objects to place them inside the fog.
Or maybe it is done inside the shader of translucent objects, where they access a volumetric texture of the fog and calculate how “deep” inside the volume the surface is?!?

I found this blogpost that covers Unreals rendering workflow: How Unreal Renders a Frame part 2 – Interplay of Light
It shows that Unreal stores a volumetric texture for shading. This answers the question of how translucent objects can appear inside of the fog. But does someone know if it is possible to write my own volume-data into this texture? Is it even possible to visualize this texture by getting access to it in the shadergraph?

Thanks in advance! :slight_smile:

I read about that volumetric texture. It’s also not used in every scenario involving translucency/fog, specifically volumetric fog. Perhaps an easier way to get the intended results is to create a volumetric fog from material and Niagara effect / particle system. It would actually be far more responsive to other variables such as wind, projectiles, and other things by using features for a particle system. However, I don’t know what you’re exactly intending to do, so that’s likely not applicable or preferred. Thanks for posting the link.

Another issue with getting the translucent object to render inside of the volumetric fog, and not merely in front of and/or behind it, is shadows. I’m starting to explore this aspect of Unreal too, so try not to confuse what I say with somehow being an expert solution.