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.

my problem

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:

http://www.babylonjs.com/cyos/#caru2#2


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -