叶子的粒子
Leaf Particles
Leaf particle textures are similar to basic assets in that they allow you to define up to 16 variations which will be spawned randomly.
叶颗粒的材质与基础的材质相似,允许你自己制作多达16种随机生成的叶颗粒
There are 3 types of leaf particles (default, jungle, spruce), but you can define your own leaf types. To do this, you need to have a mapping file assets/betterfoliage/leafTextureMappings.cfg in your pack. Here is what the default one looks like:
初始状态提供3种叶颗粒(原版,丛林木,云衫木),但是你可以制作你自己的叶子类型的颗粒。你需要在你的材质包里添加:assets/betterfoliage/leafTextureMappings.cfg
// Vanilla
spruce=spruce
jungle=jungle
// Biomes O' Plenty
fir=spruce
Lines starting with // are comments, and are ignored.
行头带有//是代表评注,可忽略
Otherwise, lines are expected to have a mapping in the format of TEXTURENAME=TYPE or DOMAIN:TEXTURENAME=TYPE. The way it works is, for every leaf block using a texture that contains TEXTURENAME in its name, leaf particles spawned from that block will be of type TYPE, and use filenames of assets/betterfoliage/textures/blocks/falling_leaf_TYPE_X.png (where X is an index between 0...15). Using the DOMAIN option, you can restrict the matching to only consider textures under assets/DOMAIN.
并且,需要以这样的格式 DOMAIN:TEXTURENAME=TYPE
或者 TEXTURENAME=TYPE 地址是assets/betterfoliage/textures/blocks/falling_leaf_TYPE_X.png(X是0~15的一个数)
All leaf blocks with no mapping specified in this file will have the type default.
For example, Biomes O Plenty fir leaves have the block texture assets/biomesoplenty/textures/blocks/leaves_fir_fast.png or assets/biomesoplenty/textures/blocks/leaves_fir_fancy.png, depending on graphics settings. Because the name contains fir, the type of the leaf block will be spruce, and spawn the appropriate particles. All other leaf blocks from other mods which contain the word fir in its texture name will also be of type spruce. If the last rule in the file had been biomesoplenty:fir=spruce, then the rule would only match fir leaves from Biomes O Plenty (to be precise, textures under assets/biomesoplenty), but not other mods.
There are no restrictions on leaf particles - you can have any number of leaf types, textures can be any resolution you wish, and they can also be animated.
材质
General Assets
Better Foliage - having started out as a replacement for Better Grass & Leaves - retains the texture naming scheme of its predecessor for most assets (anything besides leaves and leaf particles). This is to ensure backward compatibility without resource packs having to make changes.
Most of these assets support up to 16 variations, indexed 0..15 at the end of the file name. The actual texture used for drawing is chosen in a random but deterministic way. This is to provide variety, and to break up any repeating visual patterns.
Here is a list of assets which support variations:
better_algae_X.png
better_cactus_arm_X.png (part of the cactus sticking out)
better_coral_X.png (part of the coral sticking out)
better_crust_X.png (flat part of the coral)
better_grass_long_X.png (used - ironically - for Short Grass)
better_grass_short_X.png (currently unused, but retained from BG&L)
better_grass_side_X.png (used for Hanging Grass)
better_grass_snowed_X.png (used for Short Grass with snow)
better_lilypad_flower_X.png
better_lilypad_roots_X.png
better_mycel_X.png (Short Grass for mycelium blocks)
better_mycel_side_X.png (currently unused)
better_netherrack_X.png (netherrack Hanging Vines)
better_reed_X.png
rising_soul_X.png (Rising Soul particles - head)
There are also 2 textures with no variations:
better_cactus.png (the center part of cactus)
soul_track.png (Rising Soul particles - trail)
When in doubt, look inside the Better Foliage JAR to see how things are set up.
密叶
Round Leaves
Better Foliage creates its own textures for Round Leaves in order to have out-of-the-box compatibility with all mods. This gives adequate results in most cases, but things may start to look weird at higher resolutions. Therefore you also have the option of providing your own custom textures to use for Round Leaves and not rely on the generation process.
Similar to the basic textures which can have variations, Round Leaf textures have 4 "built-in" variations, as they are randomly rotated a multiple of 90° when drawing.
Texture Generation
The generation process is actually very simple. The textures of each leaf block are tiled in a 2x2 grid, and then a transparency mask is applied (except for Shaders Mod normal and specular maps) to basically strip away the corners and leave a round outline. This means that generated Round Leaf textures are always double the size of the original leaf texture.
The transparency mask is located at assets/betterfoliage/textures/blocks/leafmask_X_default.png, where X is the size of the leafmask. When generating, Better Foliage first looks for a leafmask of double the size of the leaf texture. If it is not found, progressively smaller masks are tried, halving the size each time. That means if you have a 64x leaf texture, first leafmask_128_default.png is tried, then leafmask_64_default.png, leafmask_32_default.png, etc. This way, you can have a transparency mask with a resolution matched with your other textures, but things will work fine if you don't want to provide it. If a smaller leafmask is used, it will of course be scaled up (and look quite pixelated).
Because vanilla textures (and most default mod textures) are 16x, Better Foliage only comes with a leafmask_32_default.png by default.
There are a few other leafmasks to be found in the JAR, but don't let them confuse you. These are only leftovers from a feature that was dropped.
Custom Textures
Providing custom Round Leaf textures is just a matter of having the texture in a specific location. Normally, block textures can be found in the following hierarchy:
assets/MOD/textures/blocks/TEXTURE.png
Where MOD and TEXTURE are of course just placeholders for the mod and texture names. Before generating a Round Leaf texture for a leaf block, Better Foliage will look at the following location:
assets/betterfoliage/MOD/textures/blocks/TEXTURE.png
If a texture is found there, it will be used instead of generating. Basically, you provide the Round Leaf textures in the same hierarchy, just shoved under assets/betterfoliage instead of simply assets. This works the exact same with Optifine CTM textures.
Here are a few real-life examples to make it more obvious:
assets/minecraft/textures/blocks/leaves_oak.png
becomes
assets/betterfoliage/minecraft/textures/blocks/leaves_oak.png
assets/biomesoplenty/textures/blocks/leaves_pinkcherry_fancy.png
becomes
assets/betterfoliage/biomesoplenty/textures/blocks/leaves_pinkcherry_fancy.png
assets/minecraft/mcpatcher/ctm/organic_and_soft_material/leaves/aleaves/1.png
becomes
assets/betterfoliage/minecraft/mcpatcher/ctm/organic_and_soft_material/leaves/aleaves/1.png
|