# PBR texture splatting (up to 64 textures)

**URL:** <https://forum.babylonjs.com/t/pbr-texture-splatting-up-to-64-textures/1994>\
**Category:** Questions\
**Created:** [March 20, 2019, 7:48am UTC](https://forum.babylonjs.com/t/pbr-texture-splatting-up-to-64-textures/1994 "2019-03-20T07:48:08Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![Raggar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raggar/32/20672_2.png) [@Raggar](https://forum.babylonjs.com/u/Raggar)\
**Post date:** [May 9, 2019, 3:39pm UTC](https://forum.babylonjs.com/t/pbr-texture-splatting-up-to-64-textures/1994/28 "2019-05-09T15:39:41Z")

</div>

> [@sable](#):
>
> I don’t have much to contribute here, except I’d be weary of assuming wide support for texture2DLodEXT. [WebGL Stats](https://webglstats.com/webgl/extension/EXT_shader_texture_lod) shows support to be at ~50%, mainly due to mobile support only being around ~40% (though having said that, from a brief check of the ios devices I have on hand, they do support it, and most newer androids will support webgl2 anyway).
> 
> I was looking into texture wrapping with texture atlases a few months ago, and got near to where you are now before moving on. I agree that using array textures would be far simpler, but at the cost of webgl1 support (and therefore ios support).

Yeah. I’m not developing specifically for Mobile devices(Since none of mine can run any WebGL context with more than 10FPS) 😛 , but I would prefer WebGL1. My GPU supports WebGL2, but I develop using WebGL1 for the sole reason of supported older GPU’s.

> [@phaselock](#):
>
> @Raggar hey thanks, its nice to know cos your initial post didn’t state what the main problem or use case was.
> 
> If you have to make an open world terrain, the view frustum is for first person and its not a batch asset, I’d normally ask myself if the details in the distance matter or can you take the shortcut and dof/fog pass it off. Reason is cos there’s always a cost-benefit relationship. WIth manual mipmapping, there’s higher mem consumption and texture space requirements etc. And is really not the modern approach to terrain creation these days. If your target release date is 5 yrs from now, then webgl1 support won’t matter either.
> 
> That said, the modern method is to use a macro texture on said mesh first. Then use the splatmap to decide where to blend what textures to. This avoids edge seams as there is no texture tiling and the result looks more natural. It does raise other issues tho as the workflow requires high to low poly asset creation.
> 
> I’d hate for you to spend hours pulling hairs when it could be spent making cooler stuff. Hope it helps, cheers!

I’ve actually settled on using texture/texture2D with NEAREST samplingmode. You’ll see seams and less than perfect mipmapping, but I tried prototyping a small game using it, and it will certainly suffice.  
I already use FOG , but only periodically, as it’s an “event” in the game, but haven’t tried DOF.  
I tried creating a secondary texture to use for mipmaps(bad scale, was a test):[https://www.babylonjs-playground.com/#LIVRIY#56](https://www.babylonjs-playground.com/#LIVRIY#56)  
And the 4tap algo: [https://www.babylonjs-playground.com/#LIVRIY#58](https://www.babylonjs-playground.com/#LIVRIY#58)  
But I don’t really see a difference between the 4tap and one of the first approaches: [https://www.babylonjs-playground.com/#LIVRIY#59](https://www.babylonjs-playground.com/#LIVRIY#59)  
I might have done something wrong, but I’ll just stick to the last one for performance reasons.

---

_[View the full topic](https://forum.babylonjs.com/t/pbr-texture-splatting-up-to-64-textures/1994)._
