I need to implement this code:
vec4 texturePointSmooth(sampler2D tex, vec2 uv) {
vec2 size = vec2(textureSize(tex, 0));
vec2 pixel = vec2(1.0) / size;
uv -= pixel * vec2(0.5);
vec2 uv_pixels = uv * size;
vec2 delta_pixel = fract(uv_pixels) - vec2(0.5);
vec2 ddxy = fwidth(uv_pixels);
vec2 mip = log2(ddxy) - 0.5;
return textureLod(tex, uv + (clamp(delta_pixel / ddxy, 0.0, 1.0) - delta_pixel) * pixel, min(mip.x, mip.y));
}
In unreal engine5 for texture/shaders/etc. I’m using “Material” from duplicate of papersprite2d
I’m trying to get size of input texture - no node available
I’m trying to hardcode values of size - no node to make vector available. Am i looking on a right place?