Commit aba96d23 authored by amandaghassaei's avatar amandaghassaei

small fixes

parent 04306fe7
......@@ -77,8 +77,8 @@
vec2 repeatBoundary(vec2 coord){
coord -= vec2(0.5, 0.5);
if (coord.x < 0.0) coord.x = u_textureSize.x-1.0;
else if (coord.x >= u_textureSize.x-1.0) coord.x = 0.0;
//if (coord.x < 0.0) coord.x = u_textureSize.x-1.0;
if (coord.x >= u_textureSize.x-1.0) coord.x = 0.0;
if (coord.y < 0.0) coord.y = u_textureSize.y-1.0;
else if (coord.y >= u_textureSize.y-1.0) coord.y = 0.0;
coord += vec2(0.5, 0.5);
......@@ -251,10 +251,6 @@
vec2 pos = fragCoord - pxCenter - u_dt*currentVelocity;
if (pos.x < 0.0) {
gl_FragColor = vec4(texture2D(u_material, vec2(0,pos.y)/u_textureSize).xy, 0, 0);
return;
}
if (pos.x >= u_textureSize.x-1.0) {
gl_FragColor = vec4(0, 0, 0, 0);
return;
......
......@@ -221,7 +221,7 @@ function resetWindow(){
for (var i=0;i<actualHeight;i++){
for (var j=0;j<actualWidth;j++){
var index = 4*(i*actualWidth+j);
if (j==0 && Math.floor(i/actualHeight*numCols)%2==0) material[index] = 1.0;
if (j==0 && Math.round(i/actualHeight*numCols)%2==0) material[index] = 1.0;
}
}
GPU.initTextureFromData("material", actualWidth, actualHeight, "FLOAT", material, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment