three-engine
Advanced tools
Comparing version 1.0.20 to 1.0.21
@@ -25,3 +25,3 @@ { | ||
], | ||
"version": "1.0.20", | ||
"version": "1.0.21", | ||
"description": "Engine/framework for three.js", | ||
@@ -28,0 +28,0 @@ "main": "./build/three-engine.min.js", |
@@ -52,3 +52,4 @@ /* | ||
if(!repeatTexture){ | ||
if(uv.x * aspectRatio > 1. || uv.x * aspectRatio < 0. || uv.y > 1. || uv.y < 0.) hidden = true; | ||
// NEED TO BE FIXED, SOME STRANGE BORDERS ON TEXTURE EDGES WHEN ENABLING IT | ||
// if(uv.x * aspectRatio > 1. || uv.x * aspectRatio < 0. || uv.y > 1. || uv.y < 0.) hidden = true; | ||
} | ||
@@ -60,8 +61,22 @@ | ||
else{ | ||
uv.x = mod(uv.x * aspectRatio, 1.) / aspectRatio; | ||
uv.y = mod(uv.y, 1.); | ||
if(repeatTexture){ | ||
while(uv.x > 1.){ | ||
uv.x -= 1.; | ||
} | ||
while(uv.y > 1.){ | ||
uv.y -= 1.; | ||
} | ||
while(uv.x < 0.){ | ||
uv.x += 1.; | ||
} | ||
while(uv.y < 0.){ | ||
uv.y += 1.; | ||
} | ||
// uv.x = mod(uv.x, 1.); | ||
// uv.y = mod(uv.y, 1.); | ||
} | ||
vec2 pos = vec2(uv.x / tileCount.x * aspectRatio + tileOffset.x, uv.y / tileCount.y + tileOffset.y); | ||
pixel = texture2D(uTexture, pos) * colorMultiplier + colorAdd; | ||
} | ||
pixel = texture2D(uTexture, pos); | ||
} | ||
@@ -68,0 +83,0 @@ gl_FragColor = pixel; |
1262050
19120