Voxel Plugin Integration
Last updated
Last updated
Only Voxel Plugin 2.0 versions 340.0, 340.1, and 340.3 are supported. Compatibility with dev
versions may be possible by replacing outdated nodes in the Voxel Graph.
Integration with the Voxel Plugin made as easy as it gets.
Create a Voxel Graph with a sphere surface and assign a MI_PlanetOcean
in the Generate Marching Cube Surface node. Alternatively, you can download a simple graph made for convenience (don't forget to assign the material instance in there).
Drag and drop the Voxel Graph to the world. Go to the BP_PlanetaryOcean
and switch the MeshMode
to the VoxelPluginsMesh
.
Make sure that SphereRadius
in BP_PlanetaryOcean
matches the radius of the sphere in the Voxel Graph. Otherwise, buoyancy will have issues.
If the surface has not enough polygon density for your waves settings, lower the Voxel Size
in the Voxel Graph.
World position of BP_PlanetaryOcean
should match the world position of the Actor with your Voxel Surface, if you want to use buoyancy.
You don't necessarily have to have a solid sphere in the Voxel Graph. You may remove parts of the sphere using noise that represents your continents, so that the surface appears only where the water is supposed to be. This approach may be used to remove water from the areas below continents, if you'd like to dig in there. The only requirement is, all parts of the surface should match the overall shape of a perfect sphere.
Ocean material uses material collection parameters that are updated from a BP_PlanetaryOcean
's parent class APlanetaryOcean
. This way, all wave parameters are synchronized with the buoyancy system.
In versions 340.0, 340.1, and 340.3 of the Voxel Plugin, the material's world position offset doesn't work. To fix that, go to Voxel/Shaders/VoxelMarchingCubeVertexFactory.ush
file and on line 135, replace:
with
This edit was taken from the commit 3b7b6b6 in the Voxel Plugin's dev branch.
Restart the editor. Now you should see the waves.
If you're using Unreal Engine 5.4, you must make one extra edit (see commit 15c86df) in addition to the one mentioned above.
In the Voxel/Shaders/VoxelMarchingCubeVertexFactory.ush
on line 145 (considering you have already made the edit above), paste: