
SurfaceAlbedo = texture2D(albedoSampler, newUV * albedoScale + uvOffset) Vec2 newUV = vec2((vAlbedoUV.x * splatmapRect1.w) + splatmapRect1.x, (vAlbedoUV.y * splatmapRect1.z) + splatmapRect1.y)

I also send a free uniforms to hold the rect info for the texture within the texture atlas Now i have PACKED all my textures into an atlas and assign to albedoSampler. So the texture would get 'tiled or repeated' SurfaceAlbedo = texture2D(albedoSampler, vAlbedoUV * albedoScale + uvOffset) ĪlbedoScale might contain a value like vec2(5.0, 5.0). To make my terrain textures scale or tile or repeat or whatever you call it was this: Using albedo WITHOUT texture atlas i would use 'albedoScale' which is a vec2 with the texture.uScale and texture.vScale just like in per material.

Pinging This goes out to you guys as well. I have been working on this for weeks now and i can't seem to figure this last bit of scaling/tiling the actuals splats and normals are encoded to the regular Albedo and Bump texture from the PBR Materials. got working except for applying scale like shown above. TextureAtlas is perfect, can do all of texture now with just 1 additional texture to the PBR pipeline.SPLATMAP TEXTURE. So your browser would need at least 32 for the MAX_TEXTURE_IMAGE_UNITS (which are 16 on most browsers and 8 on iOS) for a fully loaded splatmap. Thats 28 ADDITIONAL texture i would have to load into my splatmap shader (on top of the standard PBR textures. Otherwise i have to go back to using operate textures for each terrain splatmap (up to 4) and each texture splat (up to 12) and each normal splat (up to 12). How can i offset the scale or limit the region the texture() function uses so it can REPEAT the section from texture atlas. SurfaceAlbedo = atlas1Color * baseColor1.r Vec4 atlas1Color = texture2D(albedoSampler, atlas1UV * atlas1Scale + uvOffset) Vec2 atlas1Scale = vec2(atlasInfo1.x, atlasInfo1.y)

Vec2 atlas1UV = vec2((vTerrainUV.x * atlasRect1.w) + atlasRect1.x, (vTerrainUV.y * atlasRect1.z) + atlasRect1.y) WORKS except when i need scale or tiling: This is the followingg snippet to get splat 1. But using a texture atlas going outside the 0 to 1 by multiplying uvcoord * scaleTile causes the texture() function to return the OTHER parts of the splats. Now i assume the default way openGL texture() function works is anything outside the 0 - 1 for uv causes the texture2D to 'REPEAT' the texture giving use tiling. So atlasScale might be something like vec2(5,5) I also have a vec2 (atlas1Scale) that is the texture offset/tiling I have a vec4 (atlas1UV) containing the rectangle of the texture within the texture atlas (x, y, height, width). This is how i am having main UV coord offset for texture atlas: Yo I am having trouble with apply terrain texture atlas tiling (texture.uScale and texture.vScale) at the shader for texture atlas.
