Shaderboard

A Minecraft mod that exposes client-side scoreboard values to post-effect shaders via named bindings.

Редакция NLZONE · 2 мин чтения · 0 просмотров
Shaderboard
Скачать Shaderboard26.3 · с официальной страницы: modrinth.com
Перейти к загрузке

Что это

A Minecraft mod that exposes client-side scoreboard values to post-effect shaders via named bindings.

  • Тип: мод
  • Загрузчик: fabric, neoforge
  • Версии Minecraft: 26.3
  • Скачиваний на Modrinth: 1 059

Подробно

Shaderboard Shaderboard lets vanilla resource-pack post-effect shaders read client-side scoreboard values through named bindings.

A binding is declared inside a post-effect's JSON file (the same file that defines its passes). This mod turns each binding into a real GLSL uniform block with a GPU buffer, and rewrites those buffers with live scoreboard values every frame. Shaders can then use those values however they like.

> Note: This mod is for vanilla /posteffect command shaders. It does not target shaders from mods like Iris and Optifine.

Declaring bindings Add a "shaderboard:bindings" array at the root of a post-effect JSON, next to "targets" and "passes". Here is an example: json { "targets": { ... }, "passes": [ ... ],

"shaderboard:bindings": [ { "uniformname": "uSteveScore", "type": "shaderboard:scoreboardobjective", "objective": "example1", "target": { "type": "player", "name": "Steve" } } ] }

Where: - uniformname - Name of the GLSL uniform block a binding creates. - type - Binding type. I.e. the type of information a binding exposes.

When type is shaderboard:scoreboardobjective: - objective - Scoreboard objective name. - target - Defines which score of an objective to bind. - type - The type of target to bind to; local player's score (localplayer), a specific player's score (player), the top score (topplayer), or a fixed-size array of scores (array). - name - When type is player, this additional field defines "which player".

> Note: This is just one example of many possibilitis; from passing arrays of scores to passing other client-sided information, etc etc. Please refer to the wiki for more information.

> Important : Scoreboard scores are server-sided and by default do not synchronize with clients. To resolve this, use one of the two following solutions: > 1. /scoreboard objectives setdisplay ... - Makes the vanilla game synchronize an objective's values with the client by visually displaying it on-screen. > 2. /scoreboard objectives shaderboard:sync ... (v2.4.0+) - This mod's way of synchronizing objective values with clients in the background, without needing setdisplay. Requires installing this mod on the server-side.

Each binding's uniformname becomes a layout(std140) uniform block. Its contents are defined by the binding's value type. Scalar scoreboard targets produce a single int:

glsl layout(std140) uniform uTopScore { int topScore; }; layout(std140) uniform uSortedScoresAZ { int sortedScores[16]; };

void main() { //base output color fragColor = texture(In

Как установить

Скачайте файл на официальной странице ниже и положите его в папку mods (для модов) или plugins (для плагинов) вашего сервера или клиента. Для модов нужен совместимый загрузчик. Версия должна совпадать с версией Minecraft.

Текст подготовлен автоматически из описания на Modrinth и ждёт проверки редакцией.

Редакция NLZONE

Пишем о серверах, модах и играх, в которые играем сами. Нашли ошибку — напишите нам, исправим.

Комментарии 0

Комментарии к этому материалу отключены.

Читайте также