Adaptive Outline

the outline lightens and darkens

Редакция NLZONE · 2 мин чтения · 1 просмотр
Adaptive Outline
Скачать Adaptive Outline1.20 – 1.21.9 · с официальной страницы: modrinth.com
Перейти к загрузке

Что это

the outline lightens and darkens

  • Тип: шейдеры
  • Загрузчик: iris, optifine
  • Версии Minecraft: 1.20 – 1.21.9
  • Скачиваний на Modrinth: 3 488

Подробно

This is a vanilla shader with a stroke. The stroke brightens the light areas and darkens the dark areas.

uniform sampler2D colortex0; uniform sampler2D depthtex0;

in vec2 texcoord; layout(location = 0) out vec4 color;

void main() { vec2 texel = 1.0 / vec2(textureSize(colortex0, 0)); vec4 scene = texture(colortex0, texcoord); float dcenter = 1.0 - textureLod(depthtex0, texcoord, 0.0).r; vec2 offsets[2] = vec2[]( vec2(texel.x, 0), vec2(texel.x 3.0, 0) ); float gradients[4]; for(int i = 0; i 2.0; bool isrealedgev = gradientratiov > 2.0; float edge = 0.0; if(isrealedgeh || isrealedgev) { float maxgradient = max(gradients[0], gradients[2]); edge = maxgradient 500.0; } float depthprecision = 0.001 + dcenter 0.01; if(edge threshold && (isrealedgeh || isrealedgev)) { float edgestrength = clamp((edge - threshold) 2.0, 0.0, 1.0); vec4 colorup = texture(colortex0, texcoord + vec2(0, texel.y)); vec4 colordown = texture(colortex0, texcoord - vec2(0, texel.y)); vec4 colorleft = texture(colortex0, texcoord - vec2(texel.x, 0)); vec4 colorright = texture(colortex0, texcoord + vec2(texel.x, 0));

vec4 avgcolor = (colorup + colordown + colorleft + colorright) 0.25;

float neighborbrightness = dot(avgcolor.rgb, vec3(0.299, 0.587, 0.114));

float brightnessfactor; if(neighborbrightness > 0.35) { // here we change the change threshold brightnessfactor = 1.0 + edgestrength 0.2; // we're changing it here brightens } else { brightnessfactor = 1.0 - edgestrength 0.2; // we're changing it here darkens } color.rgb = scene.rgb brightnessfactor; color.a = scene.a; } else { color = scene; } }

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

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

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

Редакция NLZONE

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

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

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

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