Minimum Viable Product for Half Grid Support#2106
Minimum Viable Product for Half Grid Support#2106apradhana merged 32 commits intoAcademySoftwareFoundation:masterfrom
Conversation
danrbailey
left a comment
There was a problem hiding this comment.
This looks good in general. However, if we do go this route and split this into two separate PRs, this first PR should disable anything for which we need a compute type algorithm, for example BoxSampler::sample(). There should be a static assert ensuring that it is not a half tree, otherwise this will (currently) do trilinear interpolation at half type which will ultimately change behavior when we subsequently add compute type.
danrbailey
left a comment
There was a problem hiding this comment.
I did a more thorough review of this yesterday. I think this all looks good, but my main concern remains that we are not explicitly disallowing half support for some algorithms where we haven't figured out compute type yet. I appreciate that the goal is to do like what you have done with level set sphere and to switch these algorithms from std::is_floating_point to openvdb::is_floating_point and that makes sense to me, but not all algorithms that are designed to work with floating-point grids have a static assert for std::is_floating_point unfortunately.
One such example is the LevelSetAdvection class, this currently works with any grid type and doesn't even validate that the grid must be a level set. As a result we are implicitly breaking backwards compatibility if we subsequently adapt this algorithm to use float as the compute type for HalfGrids in the future. I would be happy if we at least audit the tools and add explicit static asserts for half for any tool that doesn't already have a std::is_floating_point static assert.
Migrate over core changes from PR 1730 Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
* Removes ComputeType from tree & grid. * The same method still work with half grids. * Only now they infer the ComputeType through ComputeTypeFor<ValueType>::type. * A lot of methods now let the user choose the compute type through an optional template argument. * Defaulting to ComputeTypeFor<ValueType>::type when user omits the parameter. Note: The grid sampler's method sample (BoxSampler, etc) can now take an optional compute type template argument. I think this breaks backward compatibility on users with custom samplers because the GridSampler class will pass in the compute type to SamplerT::sample() now. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
…lied. Restrict ComputeType to be computed, rather than optionally user supplied. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Whitespace Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Uses ComputeType during Renormalization to prevent catastrophic error with small voxel size. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
ComputeType computations for finite differences. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Compute and return finite differences and other operators in terms of ComputeType. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Removes incorrect template arguments. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Explicitly return halfs. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
double to float. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Fixes unused-local-typedef errors. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Correct variables. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Fixes more unused-local-typedef errors. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Correct return types. Signed-off-by: ghurstunither <62885595+ghurstunither@users.noreply.github.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Vec3. Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
…e instantiation. Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
501ffc8 to
80e48d2
Compare
Signed-off-by: apradhana <andre.pradhana@gmail.com>
Signed-off-by: apradhana <andre.pradhana@gmail.com>
danrbailey
left a comment
There was a problem hiding this comment.
Thanks Andre, looks good! Squash before merge please. :)
|
Thank you for shepherding @ghurstunither and I to get this in, @danrbailey and @Idclip . Appreciate all the code reviews and comments. |
This PR is trying to offer a Minimum Viable Product for Half Grid Support in OpenVDB 13.
Things covered in the PR are: