-
Notifications
You must be signed in to change notification settings - Fork 9
Terrain clipping too close #8
Comments
I know about this bug for a while, and there is no way to fix it... until the first feature of this list gets done in Godot Engine ^^" ==> godotengine/godot#9046 The cause is basically that the module renders terrain patches by using shader displacement, but it creates a difference between the AABB of the mesh used (a flat plane with optional seams) and the visual result. The Godot renderer then fails to cull patches properly... Some advice: |
I figured that out after posting the issue! There is no other way to displace the plane? like accessing the mesh data? |
That's how the module worked before, every patch had its own mesh, but shader displacement ended up being faster, and costs less memory. |
Oh i see, do you even know where to start reading in the engine code, where the AABB is taking the original mesh data instead of the one displaced by the shader? |
Somewhere in |
I was looking in the visualserver code and realice that |
It should not be here, make_flat_chunk() isn't actually called for each chunk update. I am currently giving a try at adding per-instance custom AABBs to the Godot renderer. Once I have it, I will be able to set the AABB in here instead: godot_heightmap_module/height_map.cpp Line 388 in 61d3855
|
First tests look promising, no clipping anymore :) |
Nice! I'm glad to hear that, I'll wait for the commit |
Might take some time, waiting for this first: godotengine/godot#12645 |
Hi @Zylann, is vertex painting working? |
@faculezcano map painting code is there (with chunked undo/redo etc), but not used yet for texturing nor exposed in the UI. That's something I should work on next. If you have a concern about it, please open another issue. |
I implemented AABB calculation here 968fee4, but it won't do anything because this line uses a feature Godot doesn't support yet: 968fee4#diff-6ecc4ee3460d2605411e9326fbfad3bdR91 All it needs is to have the PR I linked above to be merged, however that it is not scheduled to be in 3.0 :p |
Thank you so much @Zylann! Really is not being merged before nov 20? i am tracking this and the alpha close, if we push reduz to review your pr in the last issue of BETA APPROACHING? haha |
I talked to him on IRC, it's not going for that version, but maybe the next |
@darrylryan did you get this immediately or after moving around? |
@Zylann it did it as soon as i tried to create a new empty heightmap data |
@darrylryan it should be fixed now |
@Zylann Its working! Thanks for the fix :) 👍 |
Clipping issue fixed in ae96cf5 |
I create a heightmap with a raw file, the terrain is clipping too close and it seams that has to do with the camera pitch, when i watch to the bottom it doesnt clip.
Thanks!
The text was updated successfully, but these errors were encountered: