如题,在cocos中的导入了一个spine角色,只占用了1drawCall,在godot中占用了30+,而且多个相同spine节点也不能合批。如何解决
Godot中导入的spineDrawCall过大的问题
Importing a spine character in Cocos only takes up 1drawCall, while in Godot it takes up 30+, and multiple identical spine nodes cannot be grouped together. How to solve it
In Godot, the number of draw calls for Spine characters can be higher compared to other engines like Cocos due to how Godot handles rendering and batching. Here are some steps you can take to reduce the number of draw calls:
Texture Atlases: Ensure that your Spine assets are using a single texture atlas. This can help reduce draw calls as Godot can batch draw calls more effectively when using a single texture.
Material Sharing: Make sure that all your Spine nodes are sharing the same material. Different materials will prevent Godot from batching draw calls together.
Optimize Skeletons: Simplify your skeletons and reduce the number of slots and attachments if possible. Each slot and attachment can contribute to additional draw calls.
Use Binary Exports: Prefer using binary exports (
.skel
) over JSON exports (.spine-json
) as they are more efficient in terms of loading and processing.Check for Overdraw: Ensure that your Spine animations are not causing excessive overdraw, which can increase the number of draw calls.
Godot Settings: Check your Godot project settings for any rendering options that might affect batching and draw calls.
By following these steps, you should be able to reduce the number of draw calls for your Spine characters in Godot.
在cocos中的导入了一个spine角色,只占用了1drawCall,在godot中占用了30+,而且多个相同spine节点也不能合批。如何解决
在Godot中使用Spine时,draw call数量过多的问题可能与资源的导入和使用方式有关。以下是一些可能的解决方案:
合并纹理图集:确保所有Spine角色使用相同的纹理图集。这样可以减少draw call,因为Godot可以在一次渲染中处理同一纹理图集中的多个角色。
检查纹理设置:确保在导入Spine资源时,所有的纹理设置一致,特别是过滤模式和wrap模式。不同的设置可能导致无法合批。
使用Spine的混合皮肤功能:如果角色使用了多种皮肤,尝试将它们合并为一个皮肤,以减少纹理切换。
优化Spine资源:在Spine中导出时,尽量使用二进制格式而不是JSON格式,因为二进制格式更小且加载更快。
检查Godot的渲染设置:确保Godot项目的渲染设置已优化,特别是关于透明度和混合模式的设置。
使用SpineSprite节点:确保在Godot中使用
SpineSprite
节点,并正确设置其资源,以便Godot可以有效地管理和渲染Spine动画。
通过以上方法,可以有效减少Godot中Spine角色的draw call数量,提高渲染性能。
Welcome to our forum!
First of all, there's no need to open three different threads for the same question. It only creates unnecessary noise. Next time, please create a single thread and wait for a response—if the answer from Spinebot isn't satisfactory, you can follow up there.
Regarding your issue, that's not generally true and may be caused by your code. If we can't reproduce the problem, we won't be able to help. Could you provide a minimal reproduction project for the issue? If you can't share it here, you can send it to contact@esotericsoftware.com. If you do send an email, please include a reference to this forum post.
Davide 只有一个图集页面(尺寸小于2048*2048),我正在试着逐级排除问题的源头。我又使用texturePacker工具将spine中使用的散图导出为spine格式的图集给godot,但依然没能合批。或许问题的源头不在spine导出的设置上,而在于godot中。我在godot中尝试使用相同的材质(如shaderMaterial、CanvasItemMaterial)给spine但都无法合批。我尝试询问了AI但没能找到AI所说的一些选项。
如果没有能解决godot合批spine的方法,或许godot用户就要被迫使用godot自带的骨骼动画工具了,这对spine工具的忠实用户以及spine官方都是一个损失,希望在此问题上能得到官方工程师的协助。
We cannot help you if you don't send us a minimal reproduction project of your issue, as I said above.
Many users use spine-godot without any issue with draw calls.
@gyzbean Thanks for preparing a reproduction project. As Davide said above, you can send it to contact@esotericsoftware.com.
Harald I uploaded it to GitHub, including the Godot and Spine projects
Gyzbean/TestProject_SpineBatch