-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add foliage instancer #340
Conversation
1815d8b
to
1ab45f0
Compare
Looking great as far as i tested(ik it pretty early , but couldn't wait to check it out) even with shadows seem's like performance increase a bit as it hiding the terrain mesh, though something i notice is that using transform in terrain changes the grass location |
Alright, I have disabled transforms. |
d798183
to
085839d
Compare
3881e92
to
11eb2e7
Compare
I did a major overhaul on the asset dock and need testers. I'll merge this commit into the main tree once it's polished, before this foliage PR is finished. What should work and needs testing:
Using these options do work, but they don't fire any signals that I can detect without hacks But I made my own buttons which should be used for moving position or popping out Other notes:
This binary can be tested: |
11eb2e7
to
96aa49f
Compare
Testing: 1 Moving the dock on every sidebar or bottom seem´s to work well through when the terrain 3d node is selected and the asset dock is at the bottom it not possible to see the other tabs, meanwhile when you diselect the node and click on the tab it works well without overlapping the other docks. ( althought that is fixed when you make the editor fullscreen. 2 Resizing works but when you make it way too big it not possible to edit the corresponding texture as you can´t acces the three dots or delete. 3 Works as usual 4 I am not sure what you mean, but as far as i tried having two scenes with the same textures/ material list save to save, for example i add one new material to a scene, then save and then on the other scene the textures remain as positioned and the same as the one i recently saved. 5 Don´t have layout. 6not sure if it fine or made something wrong but sseems that when pinned it stays on screen within other tabs and when saving it stays on the same position it was put before saving, though when minimizing the godot app the screen stays in other programs unless you minimize it too, so maybe when minimizing godot you could make it so the pinned dock is also minimized, same when you open it again. |
Thanks for testing @Saul2022 .
This when Godot is in a window, or maybe a narrow height screen resolution? This is due to the minimum height of the panel. The other bottom tabs do the same thing. Especially click Audio, which has a very tall minimum height. The bar drops way below.
You can right-click to edit or middle click to clear/delete.
Two scenes open: Demo and imported. Each has a copy of Terrain3D, with different storage and asset dock. Switching back and forth between the scenes, the asset dock should populate with their respective textures, at least if Terrain3D is selected.
Layout is the dock position, size, pinned. This is saved to project settings so should be retained when you restart godot, as long as it doesn't crash.
The pin means always on top. It should stay on screen.
The dock should stay at the position it was in before you saved. I don't understand. You move the doc to bottom right, then save it, it should stay at the bottom right.
That's a good idea. I don't know if I have access to detect that, though. |
96aa49f
to
1975fde
Compare
Updates:
Bottom bar disappearing I'll ignore for now as I think it's a godot issue, as they all do it. |
e5d450f
to
5e1855b
Compare
I see no reason why you couldn't also paint trees and bushes using this same system. The only differences would be:
|
2167432
to
e7d2212
Compare
Update:
|
12923e4
to
3296160
Compare
3296160
to
eb78beb
Compare
Tested on latest action and seems like when deleting an mesh instance, engine crashes inmediatly. Also modifying the new properties like color, height etc,seems to not work with neither the generated blade nor a custom mesh. Furthermore when you try replace the terrain plugin folder on an existing project that had it already(which in this case was the one used to test last weeks grass project) it made the scene corrupted for some reason. And grass keeps dissapearing whenever i switch between scenes ( in this case a custom billboarder scene) |
Ok, I see, thanks. You mean removing a MeshAsset from the asset dock, not removing an instance with CTRL.
Only the UI elements for the tool settings are there. The functionality hasn't been implemented yet.
Not "corrupted", just unparseable because you saved a resource with a different name inside. Easily fixable by editing the file to the new resource name. Whatever you tested on last week is incompatible. Assuming you're using the demo, reset the project back to the main branch. If using your own project, that's dangerous. Reset your terrain3D resource files.
Ok, I see. Thanks for the reports. |
The first yea |
eb78beb
to
cd67e08
Compare
Update:
Terrain3D/src/terrain_3d_instancer.cpp Lines 228 to 260 in f593c53
What doesn't work is if rotate_y_only is disabled, regardless of align_to_normal or not, I want the base to stick in the ground and the top to point in any direction. You can see the tops do go in any direction, but some of the bases float above the ground. |
Fixed rotation, refined other settings, and changed the generated mesh to a default card that can be textured. This PR can start being tested with this build. Backup your storage and texture list resources, and scene. The last feature to add is undo/redo, which will come soon. |
a447416
to
b7c9848
Compare
Undo/redo now works with the instancer. This PR is feature complete. We need testers so we can merge it in a few days. Test this build. Backup your scene/storage/asset resources. https://github.com/TokisanGames/Terrain3D/actions/runs/9331382106 |
b7c9848
to
0ef55ed
Compare
@TokisanGames everything works fine, except that the player cannot collide with static objects, although there is collision, or is that intended? I also noticed a strange thing, I created this cube, slightly elongated on the sides Now I edited the Mesh itself and not the MeshInstance3D and everything became fine |
Thanks for testing. As stated, no collision generation in this PR. The PR takes the mesh from the first meshinstance in the file. Did you make the boxmesh long in its settings? Or did you scale it? Do the former. |
Everything is fine, I just didn’t immediately understand that only the size of the mesh itself is taken into account, and not its scale in Transform. Are there any plans in the future to consider the possibility of scattering scenes with all their data throughout the scene, despite the loss of optimization? |
Read the bottom of the top post for plans. All data, no. Meshes, static collision, possibly transforms. |
Testing a bit, and as far as i can check undo redo, seems to not worl( doing Crtl z and nothing happens with the meshinstance, neither it does on history tab). Then when i tried using a tree ( that composed of two meshes, the foliage and the trunk itself)as an instance, it only took into account the foliage, without the poor trunk . Then when i joined those in blender using the append function, and importing to godot as a glb it rotation worked just fine in blender and using godot base transform, but when appilying as an terrain3d instance, this happens. And adjusting the rotation in godot doesn´´t help. |
Thanks for testing. 4.3 is definitely not supported, please test with 4.2.2. Your undo tab should fill up with every operation, including instancing. It currently uses only the first mesh instance it finds in the scene file. It looks like through your importing and exporting you roasted the transform of the tree. I bet in your scene it's currently rotated, and the default transform is laying flat. Reset the transforms in blender and import again, ensuring all nodes in your scene has an empty transform. |
ok fine though 4.3 as far as it goes really looks like working (except on that damm 4.3 beta 1) though ye at the end downloading a new version of 4.2 worked, though for 4.3 beta 1 everything with parses broke(not plugin fault). |
Except your undo/redo doesn't work, and many things in the new version, and now it "upgraded" and broke your scenes so you can't go back easily. That's why we won't touch it until the RCs. I'm going to merge this in. Thanks to the couple of testers. More improvements will come as in subsequent phases but this should be usable now for more testers. |
0ef55ed
to
6d243ae
Compare
Well as for scenes breaking it was me being a complete blind(disability dumb stuff) not seeing that i installed 4.1 beta instead of 4.3 beta1 😅, atleast i had had copies alr so i didn't loose anything.
Nice |
Merged. Track additional improvements in #43 |
I have no problems using 4.3 beta 1 with a nightly build with this PR merged in. Mouse cursor, Undo/redo works fine. |
Partially addresses #43
Partially addresses #368
This PR extends the asset dock to include mesh assets.
A PackedScene can be dropped in, meaning a .glb, .fbx asset, or a .tscn. It will search the scene for all MeshInstance3Ds and currently selects the first one found.
General Changes Done
(merged)Opacity
renamed tostrength
, and >100 is allowed for all toolsTool settings are now shown instead of hidden, including brush selector(merged)CTRL Key negative input for(merged)Enable
Undo/redo redesign system(merged)Foliage Instancer Done
Enable
unchecked)Pushed to future PRs