这是什么?
Mojang 正在调整附魔光泽效果,这让我想到……如果有一种光泽效果既明显又不会遮挡你所穿盔甲的细节呢?经过三天折腾一些不太靠谱的着色器 hack,我向大家呈现:Fancy Glint,一款完全原版兼容的资源包。它会让附魔光泽在盔甲边缘变得明亮,同时礼貌地避开最精细和有趣的区域。非常适合展示你新添加的盔甲纹饰!它甚至能与其他修改光泽效果的资源包兼容!
它是如何工作的?
从 1.17 版本开始,Minecraft 的核心着色器(指导游戏如何渲染的指令)可以通过资源包进行修改。这意味着我可以替换默认的着色器逻辑(“只是把光泽纹理覆盖在盔甲上,拉伸并移动”),换成我自己的逻辑(“做同样的事,但额外做一些处理,让边缘更亮”)。
光泽几何体没有法线等信息,只有世界空间坐标和 UV 坐标,而这些信息都不太有用。因此,我使用 gl_VertexID 生成了横跨整个面的“UV”坐标。由于 Minecraft 总是以特定顺序发送顶点数据,我可以将每个顶点分配到特定的角点(例如,如果 gl_VertexID % 4 == 0,则对应 (0, 0);如果 gl_VertexID % 4 == 1,则对应 (0, 1),以此类推)。然后通过使用正弦函数,我可以实现从边缘到中心的渐变效果,而且不知为何它运行良好且表现一致。
由于这种方法依赖于特定的几何结构,很遗憾它对非盔甲物品支持不佳。因此该资源包可能仅适用于盔甲。
旧版本说明
Mojang 在 1.20 快照中做出的一个更改是减缓光泽纹理在盔甲上的移动速度。1.17-1.19 版本的旧速度与此资源包搭配效果不佳,所以我尝试将其调慢一点,但这会引入轻微的跳跃感。不过这种跳跃并不明显。
请确保使用与你 Minecraft 版本对应的资源包版本(如果你在 1.19-1.19.2 上使用 1.19 版本,它会提示“版本过新”,你可以忽略这个提示)!核心着色器在每个主要版本中都进行了更新,因此如果使用错误的版本将完全无法工作。
What is it?
Mojang is tweaking the enchantment glint, which got me thinking... what if we had a glint effect that both was obvious and didn't obscure what armor you're wearing? After three days of working on dodgy shader hacks, I present to you: Fancy Glint, a completely vanilla resource pack that makes the enchantment glint bright on the edges of your armor but politely stays away from the most detailed and interesting parts. Perfect for showing off your new trim! It even works with other glint-modifying resource packs!
How does it work?
Starting with 1.17, Minecraft's core shaders (instructions for how to draw the game) are able to be modified by resource packs. This means that I can replace the default one ("just lay the glint texture over the armor, stretch it, and move it around") with my own ("do that but also do some other stuff to make it brighter on the edges").
The glint geometry doesn’t have normals or anything, just worldspace positions and UV positions, neither of which are particularly useful. Instead, I used the gl_VertexID to generate “UV” positions that stretch across the whole faces. Since Minecraft always sends the vertices in a specific order, I can assign each one to specific corners (so if gl_VertexID % 4 == 0 , it’s (0, 0) , if gl_VertexID % 4 == 1 , it’s (0, 1) , etc.). And then by using a sin function I can get it to fade from the edges to the center, and somehow it works and is consistent.
Because this method is reliant on specific geometry, it doesn't work very well with items, unfortunately. This pack will likely remain armor-only.
Older Versions
One of the changes Mojang made in the 1.20 snapshots was to have the glint texture move across armor more slowly. The old speed in 1.17-1.19 doesn't look great with this pack, so I tried to slow it down a bit, but that adds a bit of jumpiness. It's not very noticeable though.
Make sure to use the version for your Minecraft version (the 1.19 one will say "too new" if you're on 1.19-1.19.2; you can ignore that)! The core shaders had changes in each major release, so it won't work at all if you use the wrong one.
评论 0
登录后参与评分
还没有评论,来抢沙发吧