Hi, couldn’t find it in the doc, so forced to ask here. I have to make a fairly large terrain and am considering options. May I know if PBR texture splatting is supported in babylonjs ? Average textures used should be around 16 but I reckon it might go up to 64 max.
This is not supported in the PBR at all, I guess you could use the terrain material Terrain - Babylon.js Documentation for this but it does not support as many textures.
um, stumbled upon this while browsing the src: PBRCustomMaterial. I should be able to write my own custom fragment and vertex shaders with PBR, right? Asking cos I think it should be possible to load a splatmap and texture atlases, compute the right textures via vertex.fx.
Super ugly proof of concept borrowing codes from terrainMaterial. Tried with albedo only. Note: Mixing colors is not the correct way for splatting textures. Super happy it works, now I can go make my own, rawr!
I want to inject custom codes for pbr custom material to read a roughness atlas map as a microsurfacetexture but I don’t see an easy way. What should I do?
Raise a PR for the fragment shader to have new #defines? or bite the bullet and rewrite the entire reflections calculations in CUSTOM_FRAGMENT_BEFORE_FOG?
I am trying to add support to the Unity Exporter For terrains… My Splatmap Shader gets the common GLSL EDGE SEAMS issue when using fract especally with a TEXTURE ATLAS…
Its a very early prototype and the splatmap isn’t done yet as the terrain assignments are not yet complete. My use case is all square tiles hence the tiled look. I don’t see any obvious edge seams from my side. Using 1k splatmap, diffuse, normals, roughness and macro texture for testing purposes right now.
I’m interested in how you managed to fix the issue mentioned by @MackeyK24 as well.
I’ve been doing some experimenting for the past few days, as I needed some more juice for my terrain. I’m using an atlas for my textures, as well as an atlas for my splatmaps, giving me 12 out of 16 different texture tiles in this example: https://www.babylonjs-playground.com/#LIVRIY#37
I’m only using the RGB channels in the splat atlas, so only 3 texture tiles/splat tile. But it’s good enough for me
Only real issue is the aliasing/edge issue, although I can live with that as long as I have those extra textures to play with.
Thank you for your input. I’ve now been at it for 10 days straight!! without getting satisfying results. Having linear interpolation + atlassing + working mipmaps is just too damn hard
My terrain requires loads of textures, so atlassing is a must, and at the same time, without mipmaps, or even decent mipmaps, it all looks terrible. My current stage of the terrain gives me a raging headache after 20 minutes, but it’s better than a blant and boring visual feel. I tried everything. Generating my own mipmaps(Using dds as it seems there might be a bug with ktx containers and mipmaps), all the samplingmodes, the 4-tap algo, half texel, repeated padding, various implementations and ported examples. I guess I’ll wait for Babylon to implement array textures or for someone else smarter than me to implement atlassing. I know a couple of guys are on top of it. It’s just a shame throwing away Webgl1 support, but damn