Skip to content

Instantly share code, notes, and snippets.

@SpiritAxolotl
Last active November 30, 2023 15:03
Show Gist options
  • Save SpiritAxolotl/8ddb4c94048f5252ea847deb41d89208 to your computer and use it in GitHub Desktop.
Save SpiritAxolotl/8ddb4c94048f5252ea847deb41d89208 to your computer and use it in GitHub Desktop.
Winestealth shader for NotITG
--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}
//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;
}
@SpiritAxolotl
Copy link
Author

SpiritAxolotl commented Nov 29, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment