Welcome to the official repository for Physics Mod.
Found a problem? Feel free to report a bug or open an issue with feedback.
Starting with Physics Mod Pro v170, shaderpack developers can create and include custom ocean shaders. The new v2 of Ocean Physics is only supported by Physics Mod Pro v185 and upwards.
Note
Custom ocean shaders are currently supported only when using Iris.
Add the following files to the corresponding world folders inside your shaderpack:
physics_ocean_v2.vsh
physics_ocean_v2.gsh
physics_ocean_v2.fsh
The .gsh geometry shader is optional.
Custom shadow shaders are also supported using the following filename prefix:
physics_ocean_shadow_v2
The comparison below demonstrates how a traditional water shader was converted into an ocean shader:
Special thanks to Emin for allowing me to share this example, which is based on Complementary Reimagined r5.1.1.
Important
This comparison uses Ocean Physics 1.0. For the current Ocean Physics 2.0 implementation, refer to the latest oceans.glsl file.
To support Physics Mod versions earlier than v185, use the legacy filenames without the v2 suffix:
physics_ocean.vsh
physics_ocean.gsh
physics_ocean.fsh
The old v1 implementation of oceans.glsl is available here:
View the legacy oceans.glsl implementation
Snow is rendered through the entity shader and uses the following entity ID:
uniform int entityId;
// Snow entity ID
829925Minecraft 26.2 and later only support it via the mc_Entity attribute. It also uses 829925 as ID.
Available in Physics Mod 2.2.3 and newer.
The Ragdoll API allows you to add ragdoll physics to entities from your own mod.
Your custom entities must use Minecraft's built-in ModelPart class.
Warning
Do not replace ModelPart with a custom implementation. Physics Mod hooks directly into this class to create the ragdoll physics.
Create a RagdollHook and register it using:
RagdollMapper.addHook(ragdollHook);A complete RagdollHook example is available in this repository.
Use this method to remove excessive or duplicated cubes from an entity model.
Some Minecraft features and rendering overlays can generate multiple cubes for the same model part. Without filtering, these may result in duplicated physics objects or multiple cube drops.
Use this method to define the connections between the model's cubes.
When you are unsure which model parts should be connected, print the available model-part information with:
RagdollMapper.printModelParts(model);Special thanks to fabmax for creating the PhysX JNI wrapper: