![]() #1: assign script to MeshInstance with scale != (1,1,1) # this results in a mesh with scale 1,1,1 (and scaled vertex coordinates) #Small Tool to apply the scale to a MeshInstance This isn't a custom import script but it shows one way to rescale a meshinstance: tool So that the vertices are recalculated and the scale can be reset to 1.0. I'll add here a simple script that I used to apply a scale of a mesh inside godot. has methods to scale down a mesh or to "apply scale". Personally, I prefer using meshes with scale 1 when there's no compelling reason to have otherwise. A 3D mesh of 1x1 squares scaled by factor of 3 will still have 4 vertices though. When a mesh contains more vertices/tris then this WILL naturally affect performance.Įxample: A 2D mesh of 1x1 squares will contain 4 vertices whereas a 2D mesh of 3x3 squares will contain (at least) 9 vertices. But: You might mix up things here between scale and complexity. So you can check all meshes (and materials) and alter them according to your needs.Ībout scaling: Generally, I wouldn't say that scaling does affect performance too much. They can be assigned to the import and they'll be called right after a 3D-object has been imported into a scene file. If your external tool is lacking and you don't get the right scale/measures when importing then there's also an automatic way to adjust the import. But I've experience with importing 3D meshes into Godot. I have no experience with MagicaVoxel or Voxel in general. Ideally the tiles would align perfectly with the grid so I wouldn't have to think about managing the offset, but unless I can change the pivot to be in the corner, I might need to rethink that. The example image is a 1x1x1 cube, but I've noticed the same issue with scaled 40x40x40 and 100x100x100 cubes: ![]() I've noticed while trying to create floor tiles of any size, the cube ends up being offset by. The feet on the edges are right along the bounds of the mesh in Magicavoxel, and align perfectly with the Godot grid: For example, this frame is 40x40x72 voxels. Some objects, when imported and scaled, align perfectly with the unit size in Godot. I've also seen some inconsistent behavior with scaling. Would it be a better idea to import the voxel mesh into something like Blender, scale it to the correct size there, and import the result to Godot? ![]() For example, the player constructing a building. I'd like to have a couple thousand on screen at once, and be able to add/remove them. Would using scaled meshes cause any performance issues at runtime? Just to be clear, I'm talking about meshes scaled in the editor, not dynamically via scripting. I've been playing around with different sized models and noticed that a 100x100x100 mesh takes much longer to import than a 10x10x10. The problem is that 1 voxel = 1 unit(meter) in Godot, so the imported meshes are gigantic. Having more voxels to work with means higher detailed results. I might make a tile, like a grass/dirt tile or floor of a building, that is 100x100x100 in Magicavoxel. I'm wondering about the potential impact on performance when scaling large meshes. obj and having Godot import those instead. vox files directly, but noticed it was changing the size of my meshes so I've reverted to exporting the files to. I tried installing the Magicavoxel import extension to import. ![]() I've started using Magicavoxel to create meshes for my first Godot 3D project and am trying to nail down a workflow. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |