File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,20 @@ class NBL_API2 CPolygonGeometryManipulator
72
72
{
73
73
if (!geo->isSkinned ()) return false ;
74
74
constexpr auto jointCountPerVertex = ICPUPolygonGeometry::SJointWeight::JOINT_COUNT_PER_VERTEX;
75
- for (auto & weightView : geo->getJointWeightViews ())
75
+ const auto jointViewCount = geo->getJointWeightViews ().size ();
76
+ for (auto weightView_i = 0u ; weightView_i < jointViewCount; weightView_i++)
76
77
{
77
- for (auto weight_i = 0u ; weight_i < jointCountPerVertex; weight_i++)
78
- {
79
- hlsl::vector<hlsl::float32_t , 1 > weight;
80
- weightView.weights .decodeElement (jointCountPerVertex * vertex_i + weight_i, weight);
81
- if (weight.x != 0 .f ) return true ;
82
- }
78
+ const auto & weightView = geo->getJointWeightViews ()[weightView_i];
79
+ hlsl::float32_t4 weight;
80
+ weightView.weights .decodeElement (vertex_i, weight);
81
+ if (weightView_i == jointViewCount - 1 )
82
+ {
83
+ for (auto channel_i = 0 ; channel_i < getFormatChannelCount (weightView.weights .composed .format ); channel_i++)
84
+ if (weight[channel_i] > 0 .f )
85
+ return true ;
86
+ }
87
+ else if (hlsl::any (lessThan (hlsl::promote<hlsl::float32_t4>(0 .f ), weight)))
88
+ return true ;
83
89
}
84
90
return false ;
85
91
};
You can’t perform that action at this time.
0 commit comments