这是一个允许资源包添加生物群系色调颜色/索引的模组,本质上是为草、树叶和水提供生物群系着色,并几乎任何*方块提供透明的生物群系叠加纹理。(*请参阅 1.18.2 及更低版本的注意事项)
该模组还包含几个用于原版 Minecraft 的资源包,它们会被提取到资源包文件夹并在启动时启用。
对于我没有默认包含的其他资源包,我应该在不久后会建立一个页面。
需求 / 兼容性
见下表。
1.12.2 & 1.16.5 - 在原版中 suffers 半透明纹理的视觉分层故障
1.18.2 及以上版本 - 这些版本正确实现了绊线光影,因此可以为诸如花朵等非六面体方块拥有半透明纹理。
如果你想要/必须使用修复了半透明问题的光影包,我测试了几个,它们在 1.16.5 上可以正常工作:
- AstraLex v90.0
- BSL v8.2.02
- Complementary Shaders v4.7.1
- Complementary Reimagined r2.03
对于 1.12.2 & Optifine,你也可以直接使用包含的 "(internal)" 光影包,因为它看起来与正常 MC 完全一致,同时也以微小的性能损耗修复了半透明纹理。
注意事项 - “几乎任何*方块”是什么意思?
1.19.2 及以上版本
实际上应该是所有方块。
1.18.2
它指的是所有允许使用 Forge 的 ItemBlockRenderTypes.setRenderLayer() 方法的方块。
1.16.5
它指的是所有允许使用 Forge 的 RenderTypeLookup.setRenderType() 方法的方块。
1.12.2
它指的是来自原版的所有方块以及所有未覆盖 getRenderLayer() 方法的模组方块。
如何制作使用此模组的资源包?
我不会深入讲解一般如何制作资源包,请去别处了解后再回来。
另外,请务必阅读短期待办事项列表中的第一点。
通常有两种方法可以向方块添加色调颜色(以及在 1.18.2 及以下版本中添加 RenderTypes/BlockRenderTypes)。
编辑 *.json 模型文件
这种方法仅利用现有的 .json 模型文件基础。我扩展了这些文件的功能,使其能够添加颜色色调(以及在 1.18.2 及以下版本中指定渲染类型)。
资源包根目录中的 bcfp.ini 文件
这应仅作为备用方法使用,如果模型文件真的不接受通过 .json 方法进行编辑。通常仅适用于较旧版本的 MC。
你可以在资源包的根目录中创建一个名为 bcfp.ini 的文件,并定义某个方块应该具有什么色调颜色(或 1.18.2 及以下版本的渲染类型)。
这些仅在启动时应用,不会动态重新加载。
两种方法都需要做的事情
在这两种情况下,我们都必须编辑 .json 模型文件。
“Parent” 标签
我们必须通过 "parent" 标签指向一个现有的父级模型文件,或者创建我们自己的模型。
我在 minecraft 中为已存在的模型文件包含了一些修改过的父级模型文件。编辑你的 .json 文件最简单的方法是取 "Original parent"(原始父级)列的内容,并将其替换为 "Parent w/ overlay"(带叠加层的父级)列的内容。应保留 "block/" 或 "minecraft:block/" 部分。
示例:
"parent": "block/crop_with_biome_overlay_modern"
在 1.12.2 的情况下,还有 "crop_with_biome_overlay_modern"。这只是从新版本移植了一个修复程序,使得纹理相对两侧的纹理实际上是镜像的,以便看起来像素在物理位置上位于相同位置。包含的原版资源包使用了这一点。
对于上述所有内容,你还必须指定一个新的叠加层纹理。通常叠加层纹理名称仅为 "overlay"。
如果模型可能有多个叠加层纹理,例如 "cube_with_biome_overlay",则每个纹理名称都有一个副本,后面附加了 "-overlay"。
例外情况是花盆模型,因为我们只关心盆中的植物。
对于这些修改后的模型文件中的每一个,还有一个带有第二个叠加层的版本,其名称只是在末尾附加一个 "2",另一个叠加层纹理也附加了 "2"。坦白说,我没有测试过这些,因为我没有找到它们的用途。
如果你制作自己的 .json 文件 - "tintindex" 标签
当制作自己的模型而不是依赖 "parent" 标签时,你还必须指定用于具有色调颜色的面的色调索引。
我建议你在默认 flowers+plants 资源包中查看 sunflower_top.json 以了解它们,但基本上每个应用的方块色调颜色都会获得一个从 Nr. 0 开始的色调索引(-1 是在内部不使用色调索引时的值),并向上计数。
你也可以用 7zip 提取此模组的 .jar 文件,并查看 "assets\minecraft\models\block\",因为这里有由本模组提供的修改过的父级模型文件,以便更好地理解如何编写自己的模型。但是请不要随你的资源包重新分发这些内容。
方块/色调颜色
*.json 方法
要添加色调颜色,你必须在 .json 的根目录中使用 "tintcolor" 标签(即通常在 "parent" 标签所在的位置)。
以下是有效的色调颜色:
- grass
- leaves
- water
- startup - 这是启动后存在的方块颜色,如果一个方块最初已经有方块颜色且我们要添加另一个颜色,这将很有用。
示例:
"tintcolor" : "leaves"
多个着色色的示例:
"tintcolor" : ["startup", "grass"]
在上述情况下,startup 着色色将具有着色索引 0,而 grass 着色色将具有着色索引 1。
在某些情况下,startup 着色色实际上可能已经使用了多个着色索引,在这种情况下,你应该能够多次指定 "startup" 着色色。
请注意,如果你使用该模组提供的任何修改后的父模型文件,这些文件都已经应用了 grass 的着色色,因此如果你想使用 grass 着色色,则无需再指定它。
例外情况是以 "stem" 开头的修改后模型文件,因为这些在原版中已经具有块颜色,所以它们拥有 "startup" 和 "grass" 两种着色色。
带有两个覆盖层的版本 additionally 还具有 leaves 着色色。
bcfp.ini 方法
一般来说,我们首先必须在我们新创建的 bcfp.ini 文件中添加一个块。这些使用通常的 <namespace>:<location> 格式。例如,MC 中的石头具有命名空间 "minecraft" 和位置 "stone",因此我们的初始字符串将是 "minecraft:stone"。
之后,我们可以指定以下之一:
- !grass
- !leaves
- !water
示例:
minecraft:cobble_stone!leaves
带有多重着色色的示例:
minecraft:cobble_stone!leaves!grass
bcfp.ini 文件中为空或以 # 开头的行将被忽略。
如果你难以确定块的 <namespace>:<location>,通常可以在游戏中按住 F3,然后按 H 以启用在悬停在物品栏中的块时显示它。
如果未指定着色色,则默认使用 !grass。
渲染类型
我们还必须指定游戏如何渲染我们的块。
*.json 方法
如果你了解现代资源包,你可能已经知道这一点,但我也为 1.18.2 及更早版本实现了此功能。
此 "render_type" 的标签也位于我们的 .json 文件的根目录。
有效值:
- minecraft:tripwire - 修复与 minecraft:translucent 相关的分层故障,如果你想要非六面透明块,应使用此选项。不适用于 1.12.2。
- minecraft:translucent - 如果你想在具有实心纹理的六面块上添加覆盖层,这很有用。当与非六面块模型(如植物)一起使用时,会有难看的分层故障。
- minecraft:cutout_mipped - cutout 的 mip-mapped 版本,通常用于树叶。见下文。
- minecraft:cutout - 原版中的大多数花朵。像素要么完全透明,要么完全不透明。像素被视为透明的截止点是 30% 或 76/256。
- minecraft:solid - 没有透明度的普通块。对我们来说几乎完全无用。
示例:
"render_type" : "minecraft:tripwire"
一般来说,对我们最有用的是 tripwire(或在 1.12.2 中为 translucent)。
对于旧版本,需要说明的是,多个块状态(基本上一个块状态 = 一个 *.json 文件)必须共享一个渲染类型,因为渲染类型绑定到块。因此,模组会遍历块的所有可能块状态,并使用列表中最高的一项。
bcfp.ini 方法
此方法仅适用于 1.18.2 及以下版本。
有效值:
- !tripwire
- !translucent
- !cutout_mipped
- !cutout
- !solid
示例:
minecraft:stone!grass!translucent
有关值的详细信息,请参阅 *.json 方法。
如果未指定值,则默认使用 !tripwire。
待办事项列表
短期 / 几周
- 有时在使用 Sodium 衍生模组时,渲染类型仅在启动时更改。这对资源包制作者尤为重要,因为他们如果想更改渲染类型,必须重启游戏。
移植至 Fabric,从 1.18 版本开始。 参见常见问题解答。
- 调查是否正在使用光影,因为 tripwire 光影在阴影方面经常被忽略,并在需要时将渲染类型设置为 translucent。
长期
- 也许研究修复旧版本中的图形错误,以便不需要其他模组。
- Mayyyybbeee 研究再次移植到 1.7.10。
常见问题解答
问:是否有任何性能惩罚?
是的。由于 GPU 必须为每个覆盖层绘制额外的三角形,因此存在轻微的性能惩罚。在花丛中,使用 Rubidium 时我的 FPS 大约减少了 1-2%。
我曾经建造了一堵巨大的对角线墙,大约有 +270,000 朵花。直接观看它导致我使用模组时 FPS 下降了约 18%,但我认为这并不现实。
问:Fabric 端口何时推出?
可能在几周内。 我将研究将资源包移植到自定义颜色的 Optifine 格式,因为有一些模组可以移植该功能,如 Vanadium Colors 和 Colormatic。
问:源代码何时发布?
在某一点。可能是在移植到 Fabric 之后。我想在此之前进行一些清理,因为我以前从未在互联网上发布过源代码。
问:你会为已经有此模组发布的较旧 Minecraft 版本更新模组吗?
是的,只要更新的功能对该 MC 版本有意义。
问:你会为非最新版本的主版本次要版本更新模组吗?
不会。
问:Minecraft 新版本已发布,Forge 也推出了测试版,你会立即更新模组吗?
只要 Forge 没有稳定版本,我就不会进行更新。不过,你可以尝试使用上一个 Minecraft 小版本的兼容版本,因为我不禁止模组在新的小版本上运行。
This is a mod that allows resource packs to add biome tint colors/indexes, basically biome coloring for grass, leaves and water, and give transparent biome-overlay textures to pretty much any* block. *(see notes for 1.18.2 and below)
This mod also includes a few resource packs for vanilla that are extracted to the resource pack folder & enabled at startup.
For other resource packs that I didn't include by default I should have a page up in some time.
Requirements / Compatibility
See table below.
1.12.2 & 1.16.5 - Suffers in vanilla from visual layering glitches with translucent textures
1.18.2 and above - These versions implement the tripwire shader properly so one can have translucent textures for things like flowers that are not 6-sided blocks.
If you want/have to use a shader pack that fix the translucency issue, I tested a few and these work on 1.16.5:
- AstraLex v90.0
- BSL v8.2.02
- Complementary Shaders v4.7.1
- Complementary Reimagined r2.03
For 1.12.2 & Optifine you can also just use the included "(internal)" shaderpack, as this looks exactly like normal MC, but also fixes translucent textures with a small performance hit.
Notes - What does "pretty much any* block" mean?
1.19.2 and above
Should actually be all blocks.
1.18.2
It means all blocks that are allowed to use Forge's ItemBlockRenderTypes.setRenderLayer() method.
1.16.5
It means all blocks that are allowed to use Forge's RenderTypeLookup.setRenderType() method.
1.12.2
It means all blocks from vanilla and all modded blocks that don't override the getRenderLayer() method.
How do I make a resource pack that uses this?
I won't get into how to generally make a resource pack, please go somewhere else for that and then come back.
Please also read the first point in the short term to do list.
In general there are two ways to add tint colors (and in 1.18.2 and below RenderTypes/BlockRenderTypes) to blocks.
editing *.json model files
This method just uses the already existing foundation of the .json model files. I extended the functionality of these to include being able to add color tints (and in 1.18.2 and below specify the render type).
bcfp.ini file in the root of the resource pack
This should only be used as a backup method, if the model really doesn't want to accept being edited by the .json method. Usually should only be applicable to older versions of MC.
You can create a file called bcfp.ini in the root of the resource pack and define what tint colors (or render type for 1.18.2 and below) a block is supposed to have.
These are only applied at startup and are not reloaded dynamically.
What you have to do with both methods
In both cases we do have to edit the .json model file.
"Parent" tag
We have to actually point towards an existing parent model file with the "parent" tag or make our own model.
I included a bunch of altered parents model files for the already existing model files in minecraft. The easiest way to edit your .json file is to take what is in the "Original parent" column and replace it with the "Parent w/ overlay" column. The "block/" or "minecraft:block/" part should be kept.
Example:
"parent": "block/crop_with_biome_overlay_modern"
In the case of 1.12.2 there is also "crop_with_biome_overlay_modern". This just ports back a fix from newer version where the texture of the opposing sides of a texture are actually mirrored, so that it looks like that pixels are physically in the same place for the opposing sides. The included vanilla resource packs use this.
For all the above you also have to specify a new overlay texture. Usually the overlay texture name is just "overlay".
In the case that a model may have multiple overlay textures, e.g. "cube_with_biome_overlay", there is a copy of every texture name with "-overlay" appended.
In exception to that is the flower pot model, since we only care about the plant in the pot anyway.
There is also a version for every one of these altered model files with a second overlay that is just the same name with a "2" appended at the end and another overlay texture with also "2" appended. I admittedly did not test these as I didn't find a use for them.
If you make your own .json file - "tintindex" tag
When making your own model instead of relying on the "parent" tag you also have to specify the tint indexes that are used for the faces that have them.
I would just look at sunflower_top.json in the default flowers+plants resource pack to get a feel for them, but basically every block tint color that is applied gets a tint index starting with Nr. 0 (-1 is internally when no tint index is to be used) and counting up.
You can also extract the .jar file of this mod with 7zip and look into "assets\minecraft\models\block\" as there are the altered parent model files provided by this mod, to get a better understanding how to write your own model. Please however do not redistribute these with your resource pack.
Block/Tint colors
*.json method
To add a tint color you have to use the "tintcolor" tag at the root of your .json (so where the "parent" tag usually is).
The following are valid tint colors:
- grass
- leaves
- water
- startup - This is the block color that is there after the startup, useful if a block already has a block color initially and we want to add another.
Example:
"tintcolor" : "leaves"
Example of multiple tint colors:
"tintcolor" : ["startup", "grass"]
In the above case the startup tint color will have the tint index 0 and the grass tint color will have the tint index 1.
There may be cases when the startup tint color actually already uses multiple tint index, in this case you should be able to specify the "startup" tint color multiple times.
Do note that if you use any of the altered parent model files that this mod provides, that these all already have the tint color of grass applied to them, so if you want a grass tint color you don't have to specify it.
An exception to this are the altered model files starting with "stem" as these in vanilla already have a block color, so they have the tint colors "startup" & "grass".
The version with 2 overlays additionally have a leaves tint color.
bcfp.ini method
In general we first have to add a block to our newly created bcfp.ini file. These use the usual <namespace>:<location> format. For example stone in MC has the namespace "minecraft" and the location "stone" as such our initial string would be "minecraft:stone".
After that we can specify one of the following:
- !grass
- !leaves
- !water
Example:
minecraft:cobble_stone!leaves
Example with multiple tint colors:
minecraft:cobble_stone!leaves!grass
Lines in the bcfp.ini file that are empty or start with # are ignored.
If you have trouble knowing what the <namespace>:<location> of a block is you can usually in-game hold F3 and then press H to enable showing it on hovering over a block in your iventory.
If no tint color is specified if defaults to using the !grass one.
Render type
We also have to specify how the game renders our block.
*.json method
If you know modern resource packs you should probably already know this, but I also implemented this for 1.18.2 and older.
The tag for this "render_type" and is also at the root of our .json file.
Valid values:
- minecraft:tripwire - Fixes the layering glitch with minecraft:translucent, should be used if you want none 6-sided block with transparency. Not available for 1.12.2.
- minecraft:translucent - Useful if you want to add an overlay to a 6-sided block with a solid texture. Has an ugly layering glitch when used with none 6-sided block models like plants.
- minecraft:cutout_mipped - Mip-mapped version of cutout, usually used for leaves. See below.
- minecraft:cutout - Most flowers in vanilla. Has pixels with either complete transparency or no transparency. The cut-off point of being transparent for a pixel is 30 % or 76/256.
- minecraft:solid - Normal blocks without transparency. Pretty much completly useless for us.
Example:
"render_type" : "minecraft:tripwire"
In general for us the most useful one is tripwire (or translucent in 1.12.2).
For older version it is to be said that multiple blockstates (basically one blockstate = one *.json file) have to share a rendertype, as the rendertype is bound to a block. Because of this the mod looks through all possible blockstates of a block and uses the one highest in the list above.
bcfp.ini method
This method is only valid for 1.18.2 and below.
Valid values:
- !tripwire
- !translucent
- !cutout_mipped
- !cutout
- !solid
Example:
minecraft:stone!grass!translucent
For information of the values see the *.json method.
If there is no value specified it defaults to using the !tripwire one.
To-do List
Short term / a few weeks
- Sometimes with a sodium derivative the rendertype is only changed at startup. Mostly important for resource pack makers, as they do have to restart the game if they want to change the render type.
Port to fabric starting with version 1.18. See FAQ.
- Look into determing if a shader is being used as the tripwire shader is often ignored when it comes to shadows and set the render type to translucent if needed.
Long term
- Maybe look into fixing the graphical bugs in older version so that no other mods are needed.
- Mayyyybbeee look into porting to 1.7.10 again.
FAQ
Q: Is there any performance penalty?
Yes. Since the GPU has to draw additional triangles for every overlay, there is a slight performance penalty. In a flower forest I get around 1-2 % less FPS with Rubidium.
I did once make a giant diagonal wall of about +270.000 flowers. Looking at it all directly caused me to drop like 18 % of my FPS with the mod, but I don't think that is very realistic.
Q: Fabric port when?
In a few weeks probably. Will look into porting the resource packs to the custom color Optifine format, since there are a few mods that port the functionality like Vanadium Colors & Colormatic.
Q: Source code release when?
At some point. Probably after the port to fabric. I want to clean up a bit before, as I have never released source code on the Internet before.
Q: Will you generally update the mod for older Minecraft version that already had a release of this mod?
Yes, as long as the updated functionality makes sense for this MC version.
Q: Will you update the mod for a minor version that isn't the newest of a major version?
No.
Q: A new MC version is out and Forge has a beta release, will you update the mod now?
I won't update as long as Forge doesn't have a stable release. You can however try to use a version for the last minor MC version, as I don't disallow the mod to run on newer minor version of MC.
评论 0
登录后参与评分
还没有评论,来抢沙发吧