allow world reloading
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / point_map.h
index 5330dec1d3e496bba8330c5414c822deba31ee12..006c98f93b28042b238f68468d12ab4f565a1400 100644 (file)
@@ -53,7 +53,7 @@ static struct vg_shader _shader_point_map = {
 "{\n"
 "   vec3 co = p*s;\n"
 "   vec2 r2 = rand_hash22(p.xz);\n"
-"   vec3 grid = vec3(floor(co.x),co.y,floor(co.z)) * (1.0/s);\n"
+"   vec3 grid = (vec3(floor(co.x),co.y,floor(co.z))+vec3(0.5,0.0,0.5)) * (1.0/s);\n"
 "\n"
 "   float t1 = 1.0-t;\n"
 "         t1 = 1.0-t1*t1;\n"
@@ -75,7 +75,7 @@ static struct vg_shader _shader_point_map = {
 "   vs_motion_out( vproj0, vproj1 );\n"
 "\n"
 "   gl_Position = vproj0;\n"
-"   gl_PointSize = (9.0*scaler) / (gl_Position.z + 0.01);\n"
+"   gl_PointSize = (9.0*scaler) / (max( gl_Position.z, 2.0 ));\n"
 "   aWorldCo = world_pos0;\n"
 "   aColour = a_colour*scaler*(1.0-uAnim.y*uAnim.y);\n"
 "   aCo = co;\n"