Skip to content
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

Support time-sampled computed primvars #1455

Merged

Conversation

cameronwhite
Copy link
Contributor

Description of Change(s)

This adds support for evaluating time samples of computed primvars (ExtComputation) - the primary use case is motion blur for skinned primitives.

  • Added methods to the scene delegate and prim adapter for sampling an ExtComputation scene input, similar to SamplePrimvar() and related methods
  • Implemented SampleExtComputationInput() for the skinning computation.
  • Added HdExtComputationUtils::SampleComputedPrimvarValues() for evaluating time samples of the computed primvars, along with a basic unit test

A couple notes from prior discussions with @rajabala

  • We may want to consider adjusting the strategy used when clamping the samples, or make that a parameter. Currently it matches the behaviour of SamplePrimvar()
  • The hardcoded static capacity for the HdTimeSampleArray in extComputationUtils.h is a bit unfortunate, but I'm not sure we want to turn SampleComputedPrimvarValues into a templated function

computed primvars.

Also added a VtValue specialization of HdResampleNeighbors(), for
resampling an HdTimeSampleArray of VtValue's.
If the value type can't be interpolated, just hold the previous sample's
value rather than producing a runtime warning.
This uses a simple computation to test the handling of time samples and
interpolating input samples.
@jilliene
Copy link

Filed as internal issue #USD-6575

…ghbors().

- Remove the USD dependency and just directly specify the types we
  expect to interpolate.
- Replace the BOOST_PP_SEQ_FOR_EACH usage with variadic templates.
- Fix some inconsistent code formatting.
This is similar to related methods such as SamplePrimvar().
This removes the hardcoded static capacity of 4, and templates
SampledValueStore to use the static capacity specified by the client
code.

Additionally, the internal _ExecuteSampledComputations() method is now
templated so that the static capacity of its value store arrays are also
controlled by the client.

Factored out some parts of the _ExecuteSampledComputations()
implementation that do not rely on the template parameter. This limits
the amount of code moved into the header (in particular, this also hides
the usage of internal classes such as Hd_ExtComputationContextInternal).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants