-
Notifications
You must be signed in to change notification settings - Fork 65
Fix polygon manipulator aabb computation #903
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
base: master
Are you sure you want to change the base?
Conversation
include/nbl/asset/IPolygonGeometry.h
Outdated
static const size_t JOINT_COUNT_PER_VERTEX = 4; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh ?
- Misleading name, the joints per vertex is an upper bound, also it comes from format channel counts across the joint weight views
- should be
constexpr static inline
otherwise you mess up linking - Wrong naming convention, capital snake case is for macros only, constants are capital starting camel case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually just remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still a TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -72,14 +72,20 @@ class NBL_API2 CPolygonGeometryManipulator | |||
{ | |||
if (!geo->isSkinned()) return false; | |||
constexpr auto jointCountPerVertex = ICPUPolygonGeometry::SJointWeight::JOINT_COUNT_PER_VERTEX; | |||
for (auto& weightView : geo->getJointWeightViews()) | |||
const auto jointViewCount = geo->getJointWeightViews().size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compute this at start of function outside the lambda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
for (auto channel_i = 0; channel_i < getFormatChannelCount(weightView.weights.composed.format); channel_i++) | ||
if (weight[channel_i] > 0.f) | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just do this for all views, I'm not sure I put a hard requirement that all weight and index views must have 4 component format (I just put a req that component count must match for each weight-index pair)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Fix AABB computation on cpu polygon geometry