From 1568f73c40e751ce2d1773e2911053b7403f4af4 Mon Sep 17 00:00:00 2001 From: coolGi Date: Mon, 19 Jun 2023 23:21:37 +0930 Subject: [PATCH] Edited some stuff so noise is less on transparent, bright, or dark objects --- core/src/main/resources/shaders/flat_shaded.frag | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/shaders/flat_shaded.frag b/core/src/main/resources/shaders/flat_shaded.frag index 35001662a..19abf0793 100644 --- a/core/src/main/resources/shaders/flat_shaded.frag +++ b/core/src/main/resources/shaders/flat_shaded.frag @@ -129,8 +129,8 @@ void main() float noiseAmplification = noiseIntensity / 100; - noiseAmplification = (returnColor.x + returnColor.y + returnColor.z) / 3 * noiseAmplification; // Lessen the effect on depending on how dark the object is -// noiseAmplification *= returnColor.w; // The effect would lessen on transparent objects + noiseAmplification = (-1 * pow(2*((returnColor.x + returnColor.y + returnColor.z) / 3) - 1, 2) + 1) * noiseAmplification; // Lessen the effect on depending on how dark the object is, equasion for this is -(2x-1)^{2}+1 + noiseAmplification *= returnColor.w; // The effect would lessen on transparent objects // Random value for each position float randomValue = rand(vec3(