Well this is excellent. What about adding this option to the CreateGroundFromHeightMap in the repo? Like optimize = true in the options
Yes I was planning on it, wanted some per review here first, and if we could work to fix the shadows
and I was thinking optimizeFlats = true or something, because technically it ignores any other potential optimization like if a vertical incline spanned more then 2 points but was at the same angle, it does not optimize those.
Potential future upgrades to this util could also be detecting faces for other materials at specific elevation ranges/angles. For instance cliff’s next to large bodies of water could have some different material, or beach shores etc.
The best way to move the needle here would be to submit a PR so we can all comment and work on it
Will get busy on that then.
@Deltakosh so pretty close to posting this PR, I finally got the playground running local, but I got a question, is there somewhere in the the src tree that I could include some playground source code that I use to visually debug the code? Or should i just include wherever then delete it before it gets merged?!
You can pick the local dev option in vscode and type your testing code in the localdev folder
https://doc.babylonjs.com/how_to/how_to_start#test-and-debug
im more so asking about is there a location in the source tree on github for scene’s built for debugging an feature like this… so I could submit it
I haven’t followed this thread so far, but I think it’s about reducing the generated ground number of vertices on some parts of it, is it ?
If yes, this means the ground geometry is changed and that there’s no longer the same regular subdivisions along the ground surface.
Well, the method .GetHeightAtCoordinates(x, z) assumes the fact that the geometry is regular and all the quads have the same size.
Did you check that this method still works with this optimization ?
If not, it would be pertinent to explain it in the documentation.
@jerome I’m not aware of that function, if that function works off the mesh then it should have the same result as before, if your searching for a specific vertex at (x,y) then it might not be there… but if it calculates from the vertex’s for the face at x,y then you’ll be ok