@sayi 为什么官方默认剔除是关掉的,有什么原因吗?
当然,背面剔除是故意关闭的。 这是因为任何负比例的附件(从左到右翻转它们等)都会导致缠绕顺序从 CCW 变为 CW,反之亦然,将正面变成背面。 然而,您可能希望渲染所有附件,而不仅仅是朝右的附件,因此剔除模式应设置为“无”。
您希望 Spine 骨骼启用背面剔除是否有原因?
在Spine编辑器中,Backface culling功能应用在物体上没问题,但是导入Unity中运行,Backface culling失效了,表现如图(可以看到立方体的内部)
我不确定我是否正确理解你的问题。 如果您的意思是背面剔除是剔除正面而不是背面,则需要剔除相反的缠绕顺序,而不是“Cull Back”,而使用“Cull Front”。 请注意,Unity 的命名有点不幸,因为它应该是“Cull CW”或“Cull CCW”,但 Unity 假定顺时针顺序为正面。
请注意,启用剔除时,您不能在骨骼或附件上使用负比例,否则您将剔除这些附件。 如果您必须启用剔除并且还需要负向缩放骨骼,您可以更改“MeshGenerator”中的代码来检查每个三角形的缠绕并对它们重新排序,但这可能不是您想要的。
为什么官方默认 Culling 是关掉的,有什么原因吗?
Of course, backface culling is turned off on purpose. This is because any negative scale of attachments (for flipping them from left to right, etc) would lead to the winding order changing from CCW to CW and vice versa, turning a front- into a backface. You would want to render all attachments however, not only right-facing ones, so culling mode should then be set to None
as a consequence.
Is there a reason why you want your Spine skeletons to have backface culling enabled?
在 Spine 编辑器中,Backface culling 功能应用在物体上没问题,但是导入Unity中运行,Backface culling 失效了,表现如图(能看到立方体的内部)
I'm not sure I understand your question correctly. If you mean that backface culling is culling front faces instead of back faces, you need to cull the opposite winding order, instead of Cull Back
use Cull Front
. Note that this is somewhat unfortunate naming by Unity, as it should be Cull CW
or Cull CCW
, but Unity assumes clockwise order as front-facing.
Note that when enabling culling, you can't use negative scale on bones or attachments, or you will cull these attachments. If you must have culling enabled and also need to scale bones negatively, you could change the code in MeshGenerator
to check winding of each triangle and reorder them, but this is likely not what you want.