javascript - babylon.js repeating texture seam/artifact -
i've started dabbling in shader programming using babylon.js. i'm trying write fragment shader supports repeating textures. used pretty trivial way it, can tell link.
http://www.babylonjs.com/cyos/#caru2#1
vec2 xy = vuv; vec2 phase = fract(xy / vec2(1.0/vscale,1.0/vscale)); vec3 color = texture2d(texturesampler, phase).rgb;
the problem creates strange pixelating effect on seams of repeating texture, shown following image.
how can fix this? must wrong fragment shader, because using standard material doesn't yield problem.
if eternally grateful.
wow okay i'm idiot, scaling image in stupid , inefficient way. don't think understood line:
vec2 phase = fract(xy / vec2(1.0/vscale,1.0/vscale));
was doing. i'm still not 100% on it, logical way multiply uv vector repeating factor.
vec2 phase = vec2(xy.x*vscale,xy.y*vscale);
you can see result here:
Comments
Post a Comment