Hi,
I think I found an issue on the Volume Materials, they don’t seem to work very well with Instanced Static Mesh components.
I fail to send the proper information per instance to the material, e.g. position / color / float or whatever.
Since I need to instanciate a lot of Volumetric fog volume, ISM would seem appropriate but I cannot use 3D SDF inside the materials without knowing the instance position.
You can check the project attached above with the repro steps.
Thank you,
Thomas
Steps to Reproduce
- Open the project
- Open the Level “NewMap”
- Select the ISM_Volume actor and focus on it
- Notice they are two ISM components with two different materials
-> Only the opaque material is working as expected (one white cube, one red cube)
-> The two fog volumes are only white, but they should be white and red also.
Hi Thomas,
Unfortunately, Volume Materials use a separate specialized render path and are not compatible with Instanced Static Mesh components.
When any Primitive Component is sent to the renderer with a Volume Material, its mesh is not used at all. The renderer takes only the component’s bounds and voxelizes it into the volumetric fog rendering system (enabled through the “Volumetric Fog” option on the ExponentialHeightFog actor). If you use a volume material on a Static Mesh component with a Cone mesh, for example, you will see that not only the cone shape will participate in the fog, instead its entire bounds will (see image below). The same happens with an Instanced Static Mesh component: the whole bounds of the component (calculated from the instances) will be used, and only the first set of Custom Data Floats will be available to the material.
[Image Removed]At the end of the day, ISMs are an optimized way to render the same static mesh with multiple transforms and some limited material variation, but they are not needed when using the volumetric fog (example) rendering system, since it works with its own internal voxels instead of static meshes. You can try placing meshes individually, or place Local Fog Volumes, or use Niagara Particles if appropriate. Meshes and particles with Volume Material also allow the use of Sparse Volume Textures.
If performance becomes a problem, you can try using Local Fog Volumes without enabling “Volumetric Fog” on the ExponentialHeightFog actor. Alternatively, you can fake fog (example1, example2) with a surface-domain material.
Let me know if this helps!
Best regards,
Vitor
Hi Vitor,
Thank you for the detailed answer and the references, that is much appreciated !
Regards,
Thomas