CustomGLTF
注意: 1.20.4 版本已不再维护。请使用 Minecraft 1.20.1 获取所有最新修复、功能和更新。
CustomGLTF 是一个客户端库模组,允许你在 Minecraft 中加载、动画化、附加和渲染标准的 glTF / GLB 3D 模型。
什么是 glTF?
glTF(GL Transmission Format)是一种开放标准的 3D 文件格式,几乎被所有 3D 软件支持(Blender、Maya、3ds Max、Blockbench 等)。这使得将自定义 3D 模型直接导出并导入到 Minecraft 变得非常简单。
功能
- 加载 glTF 和 GLB 文件: 支持带有网格、纹理和骨骼的标准 .gltf 和 .glb 模型。
- 完整的动画支持: 骨骼动画、节点动画以及内置的 Animation Controller(交叉淡入淡出、循环、状态机)。
- 骨骼插槽与附加系统: 可将物品、武器、粒子或其他模型附加到特定的动画骨骼上。
- 程序化骨骼覆盖: 通过代码动态控制骨骼旋转/平移(如炮塔瞄准、车辆转向、头部追踪)。
- 动态包围盒: 根据模型几何体计算精确的 3D 包围盒用于碰撞箱。
- 修复透明度和水面渲染: 干净的 Alpha 混合和片段丢弃(无黑框,模型背后的水面正确渲染)。
- GPU 加速蒙皮: 支持多种 OpenGL 配置文件(GL43、GL40、GL33 以及 GL30 CPU 回退)。
- 双语着色器警告: 当启用着色器时,游戏内聊天会显示警告(英文和德文)。
要求
- Minecraft: 1.20.1(1.20.4 已不再维护)
- Fabric Loader: 0.14.21 或更高版本
- Fabric API
- Java: 17 或更高版本
关于着色器的重要说明: 不支持着色包(Iris / OptiFine)。如果启用了着色器,游戏内将会发出通知。请禁用着色器以便 glTF 模型正确渲染。
面向模组开发者
这是一个库模组。它本身不会添加独立的物品或方块。你需要另一个使用 CustomGLTF 的模组才能在游戏中看到模型。如果你是模组开发者并希望在你的模组中使用此库,请查看仓库中的开发者指南和 API,那里有完整的模板和示例。
鸣谢
- 本模组基于 TimLee9024 和 Protoxy 开发的 MCglTF。非常感谢他们创建了原始库!
- 使用了 Marco Hutter (javagl.de) 的 JglTF 代码。
- 移植至 1.20.1 并进行更新由 Maiky 完成。
许可证
MIT 许可证。欢迎在整合包中使用此模组,或将其作为模组的依赖项。
问题与反馈
如果发现任何错误或有问题,欢迎提交 Issue 或留言评论!
CustomGLTF
Notice: 1.20.4 is no longer under maintenance. Please use Minecraft 1.20.1 for all latest fixes, features, and updates.
CustomGLTF is a client-side library mod that allows you to load, animate, attach, and render standard glTF / GLB 3D models in Minecraft.
What is glTF?
glTF (GL Transmission Format) is an open standard 3D file format supported by almost every 3D software (Blender, Maya, 3ds Max, Blockbench, etc.). This makes it super easy to export and bring custom 3D models directly into Minecraft.
Features
- Load glTF & GLB files: Standard .gltf and .glb models with mesh, textures, and bones.
- Full animation support: Skeletal animation, node animation, and built-in Animation Controller (crossfading, looping, state machine).
- Bone Sockets & Attachment System: Attach items, weapons, particles, or other models to specific animated bones.
- Procedural Bone Overrides: Control bone rotations/translations dynamically via code (turret aiming, vehicle steering, head tracking).
- Dynamic Bounding Boxes: Calculate exact 3D bounding boxes from model geometry for hitboxes.
- Fixed Transparency & Water Rendering: Clean alpha blending and fragment discarding (no black boxes, water behind models renders correctly).
- GPU-accelerated skinning: Multiple OpenGL profiles (GL43, GL40, GL33, and GL30 CPU fallback).
- Bilingual Shader Warning: In-game chat warning (English & German) when shaders are active.
Requirements
- Minecraft: 1.20.1 (1.20.4 is no longer maintained)
- Fabric Loader: 0.14.21 or higher
- Fabric API
- Java: 17 or higher
Important Note on Shaders: Shader packs (Iris / OptiFine) are NOT supported. If shaders are enabled, an in-game warning will notify you. Please disable shaders so glTF models render properly.
For Mod Developers
This is a library mod. It doesn't add standalone items or blocks on its own. You need another mod that uses CustomGLTF to see models in-game. If you're a mod developer and want to use this library in your mod, check out the Developer Guide and API in the repository for complete templates and examples.
Credits
- This mod is based on MCglTF by TimLee9024 and Protoxy. Big thanks to them for creating the original library!
- Uses code from JglTF by Marco Hutter (javagl.de).
- Ported to 1.20.1 & updated by Maiky.
License
MIT License. Feel free to use this in your modpacks or as a dependency for your mods.
Issues & Feedback
If you find any bugs or have questions, feel free to open an issue or leave a comment!
评论 0
登录后参与评分
还没有评论,来抢沙发吧