This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/modes/shaders/paint_texture_frag.glsl
Clément Foucault b98e6743dc Texture Paint: Add filtering option for texture paint overlay
The overlay should now use the texture interpolation setting in material
mode.

In image mode, there is now a new button to let the user choose the texture
filter. The option is located in the Texture Slots popover and only shows
in Image mode.
2019-01-11 16:00:23 +01:00

18 lines
340 B
GLSL

in vec2 uv_interp;
out vec4 fragColor;
uniform sampler2D image;
uniform float alpha = 1.0;
uniform bool nearestInterp;
void main()
{
vec2 uv = uv_interp;
if (nearestInterp) {
vec2 tex_size = vec2(textureSize(image, 0).xy);
uv = (floor(uv_interp * tex_size) + 0.5) / tex_size;
}
fragColor = vec4(texture(image, uv).rgb, alpha);
}