Last active
November 30, 2023 15:03
-
-
Save SpiritAxolotl/8ddb4c94048f5252ea847deb41d89208 to your computer and use it in GitHub Desktop.
Winestealth shader for NotITG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--acts exactly like stealth | |
definemod{'winestealth', function(percent, pn) | |
if not P[pn] then return end | |
local a = 0.02*math.min(100 - percent, 50) | |
local w = 0.02*math.min(percent, 50) | |
local shader = winestealth:GetShader() | |
shader:uniform1f('a', a) | |
shader:uniform1f('w', w) | |
if not P[pn]:GetArrowShader() and percent > 0 then | |
P[pn]:SetArrowShader(shader) | |
elseif percent <= 0 then | |
P[pn]:ClearArrowShader() | |
end | |
end} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Originally written by BrotherMojo | |
#version 120 | |
uniform float a; //alpha | |
uniform float w; //white | |
varying vec2 textureCoord; | |
uniform vec2 textureSize; | |
uniform sampler2D sampler0; | |
void main() { | |
vec4 texColor = texture2D(sampler0, textureCoord); | |
gl_FragColor = vec4(1.0, 1.0, 1.0, texColor[3]) * w + texColor * (1.0 -w); | |
gl_FragColor[3] = gl_FragColor[3] * a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: In NotITG versions later than 4.3.0, normal stealth will render properly on wine.
OTHER NOTE: This can still be used for stealth-like behavior for non-arrows, with minor modification to the definemod.