|
Scene delegate which observes notices from an HdSceneIndex and applies them to an HdRenderIndex. More...
#include <sceneIndexAdapterSceneDelegate.h>
Public Member Functions | |
HdSceneIndexAdapterSceneDelegate (HdSceneIndexBaseRefPtr inputSceneIndex, HdRenderIndex *parentIndex, SdfPath const &delegateID) | |
void | PrimsAdded (const HdSceneIndexBase &sender, const AddedPrimEntries &entries) override |
A notification indicating prims have been added to the scene. | |
void | PrimsRemoved (const HdSceneIndexBase &sender, const RemovedPrimEntries &entries) override |
A notification indicating prims have been removed from the scene. | |
void | PrimsDirtied (const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries) override |
A notification indicating prim datasources have been invalidated. | |
void | PrimsRenamed (const HdSceneIndexBase &sender, const RenamedPrimEntries &entries) override |
A notification indicating prims (and their descendants) have been renamed or reparented. | |
HdMeshTopology | GetMeshTopology (SdfPath const &id) override |
Gets the topological mesh data for a given prim. | |
HdBasisCurvesTopology | GetBasisCurvesTopology (SdfPath const &id) override |
Gets the topological curve data for a given prim. | |
PxOsdSubdivTags | GetSubdivTags (SdfPath const &id) override |
Gets the subdivision surface tags (sharpness, holes, etc). | |
GfRange3d | GetExtent (SdfPath const &id) override |
Gets the axis aligned bounds of a prim. | |
bool | GetVisible (SdfPath const &id) override |
Returns the authored visible state of the prim. | |
bool | GetDoubleSided (SdfPath const &id) override |
Returns the doubleSided state for the given prim. | |
HdCullStyle | GetCullStyle (SdfPath const &id) override |
Returns the cullstyle for the given prim. | |
VtValue | GetShadingStyle (SdfPath const &id) override |
Returns the shading style for the given prim. | |
HdDisplayStyle | GetDisplayStyle (SdfPath const &id) override |
Returns the refinement level for the given prim in the range [0,8]. | |
HdReprSelector | GetReprSelector (SdfPath const &id) override |
Returns the authored repr (if any) for the given prim. | |
TfToken | GetRenderTag (SdfPath const &id) override |
Returns the render tag that will be used to bucket prims during render pass bucketing. | |
VtArray< TfToken > | GetCategories (SdfPath const &id) override |
Returns the prim categories. | |
HdVolumeFieldDescriptorVector | GetVolumeFieldDescriptors (SdfPath const &volumeId) override |
GfMatrix4d | GetTransform (SdfPath const &id) override |
Returns the object space transform, including all parent transforms. | |
size_t | SampleTransform (SdfPath const &id, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override |
Store up to maxSampleCount transform samples in *sampleValues. | |
size_t | SampleTransform (SdfPath const &id, float startTime, float endTime, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override |
GfMatrix4d | GetInstancerTransform (SdfPath const &instancerId) override |
Returns the instancer transform. | |
size_t | SampleInstancerTransform (SdfPath const &instancerId, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override |
Store up to maxSampleCount transform samples in *sampleValues. | |
size_t | SampleInstancerTransform (SdfPath const &instancerId, float startTime, float endTime, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override |
HdPrimvarDescriptorVector | GetPrimvarDescriptors (SdfPath const &id, HdInterpolation interpolation) override |
Returns descriptors for all primvars of the given interpolation type. | |
VtValue | Get (SdfPath const &id, TfToken const &key) override |
Returns a named value. | |
VtValue | GetIndexedPrimvar (SdfPath const &id, TfToken const &key, VtIntArray *outIndices) override |
Returns a named primvar value. | |
size_t | SamplePrimvar (SdfPath const &id, TfToken const &key, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override |
Store up to maxSampleCount primvar samples in *samplesValues. | |
size_t | SamplePrimvar (SdfPath const &id, TfToken const &key, float startTime, float endTime, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override |
size_t | SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, size_t maxNumSamples, float *times, VtValue *samples, VtIntArray *sampleIndices) override |
SamplePrimvar() for getting an unflattened primvar and its indices. | |
size_t | SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, float startTime, float endTime, size_t maxNumSamples, float *times, VtValue *samples, VtIntArray *sampleIndices) override |
std::vector< VtArray< TfToken > > | GetInstanceCategories (SdfPath const &instancerId) override |
Returns the categories for each of the instances in the instancer. | |
VtIntArray | GetInstanceIndices (SdfPath const &instancerId, SdfPath const &prototypeId) override |
Gets the extracted indices array of the prototype id used in the instancer. | |
SdfPath | GetInstancerId (SdfPath const &primId) override |
Returns the parent instancer of the given rprim or instancer. | |
SdfPathVector | GetInstancerPrototypes (SdfPath const &instancerId) override |
Returns a list of prototypes of this instancer. | |
SdfPath | GetMaterialId (SdfPath const &id) override |
Returns the material ID bound to the rprim rprimId . | |
VtValue | GetMaterialResource (SdfPath const &id) override |
HdIdVectorSharedPtr | GetCoordSysBindings (SdfPath const &id) override |
Returns the coordinate system bindings, or a nullptr if none are bound. | |
HdRenderBufferDescriptor | GetRenderBufferDescriptor (SdfPath const &id) override |
Returns the allocation descriptor for a given render buffer prim. | |
VtValue | GetLightParamValue (SdfPath const &id, TfToken const ¶mName) override |
VtValue | GetCameraParamValue (SdfPath const &cameraId, TfToken const ¶mName) override |
Returns a single value for a given camera and parameter. | |
HdExtComputationPrimvarDescriptorVector | GetExtComputationPrimvarDescriptors (SdfPath const &id, HdInterpolation interpolationMode) override |
Returns a list of primvar names that should be bound to a generated output from an ExtComputation for the given prim id and interpolation mode. | |
TfTokenVector | GetExtComputationSceneInputNames (SdfPath const &computationId) override |
For the given computation id, returns a list of inputs which will be requested from the scene delegate using the Get() method. | |
VtValue | GetExtComputationInput (SdfPath const &computationId, TfToken const &input) override |
Returns a single value for a given computation id and input token. | |
size_t | SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override |
Return up to maxSampleCount samples for a given computation id and input token. | |
size_t | SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, float startTime, float endTime, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override |
HdExtComputationInputDescriptorVector | GetExtComputationInputDescriptors (SdfPath const &computationId) override |
For the given computation id, returns a list of computation input descriptors. | |
HdExtComputationOutputDescriptorVector | GetExtComputationOutputDescriptors (SdfPath const &computationId) override |
For the given computation id, returns a list of computation output descriptors. | |
std::string | GetExtComputationKernel (SdfPath const &computationId) override |
Returns the kernel source assigned to the computation at the path id. | |
void | InvokeExtComputation (SdfPath const &computationId, HdExtComputationContext *context) override |
Requests the scene delegate run the ExtComputation with the given id. | |
TfTokenVector | GetTaskRenderTags (SdfPath const &taskId) override |
void | Sync (HdSyncRequestVector *request) override |
Synchronizes the delegate state for the given request vector. | |
void | PostSyncCleanup () override |
Opportunity for the delegate to clean itself up after performing parallel work during sync phase. | |
Public Member Functions inherited from HdSceneDelegate | |
HD_API | HdSceneDelegate (HdRenderIndex *parentIndex, SdfPath const &delegateID) |
Constructor used for nested delegate objects which share a RenderIndex. | |
HdRenderIndex & | GetRenderIndex () |
Returns the RenderIndex owned by this delegate. | |
SdfPath const & | GetDelegateID () const |
Returns the ID of this delegate, which is used as a prefix for all objects it creates in the RenderIndex. | |
virtual HD_API void | Sync (HdSyncRequestVector *request) |
Synchronizes the delegate state for the given request vector. | |
virtual HD_API void | PostSyncCleanup () |
Opportunity for the delegate to clean itself up after performing parallel work during sync phase. | |
virtual HD_API bool | IsEnabled (TfToken const &option) const |
Returns true if the named option is enabled by the delegate. | |
virtual HD_API HdModelDrawMode | GetModelDrawMode (SdfPath const &id) |
Returns the model draw mode object for the given prim. | |
template<unsigned int CAPACITY> | |
void | SampleTransform (SdfPath const &id, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa) |
Convenience form of SampleTransform() that takes an HdTimeSampleArray. | |
template<unsigned int CAPACITY> | |
void | SampleTransform (SdfPath const &id, float startTime, float endTime, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa) |
Convenience form of SampleTransform() that takes an HdTimeSampleArray. | |
template<unsigned int CAPACITY> | |
void | SampleInstancerTransform (SdfPath const &instancerId, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa) |
Convenience form of SampleInstancerTransform() that takes an HdTimeSampleArray. | |
template<unsigned int CAPACITY> | |
void | SampleInstancerTransform (SdfPath const &instancerId, float startTime, float endTime, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa) |
Convenience form of SampleInstancerTransform() that takes an HdTimeSampleArray. | |
template<unsigned int CAPACITY> | |
void | SamplePrimvar (SdfPath const &id, TfToken const &key, HdTimeSampleArray< VtValue, CAPACITY > *sa) |
Convenience form of SamplePrimvar() that takes an HdTimeSampleArray. | |
template<unsigned int CAPACITY> | |
void | SamplePrimvar (SdfPath const &id, TfToken const &key, float startTime, float endTime, HdTimeSampleArray< VtValue, CAPACITY > *sa) |
Convenience form of SamplePrimvar() that takes an HdTimeSampleArray. | |
template<unsigned int CAPACITY> | |
void | SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, HdIndexedTimeSampleArray< VtValue, CAPACITY > *sa) |
Convenience form of SampleIndexedPrimvar() that takes HdTimeSampleArrays. | |
template<unsigned int CAPACITY> | |
void | SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, float startTime, float endTime, HdIndexedTimeSampleArray< VtValue, CAPACITY > *sa) |
Convenience form of SampleIndexedPrimvar() that takes HdTimeSampleArrays. | |
virtual HD_API SdfPath | GetScenePrimPath (SdfPath const &rprimId, int instanceIndex, HdInstancerContext *instancerContext=nullptr) |
Returns the scene address of the prim corresponding to the given rprim/instance index. | |
virtual HD_API SdfPathVector | GetScenePrimPaths (SdfPath const &rprimId, std::vector< int > instanceIndices, std::vector< HdInstancerContext > *instancerContexts=nullptr) |
A vectorized version of GetScenePrimPath that allows the prim adapter to amortize expensive calculations across a number of path evaluations in a single call. | |
template<unsigned int CAPACITY> | |
void | SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, HdTimeSampleArray< VtValue, CAPACITY > *sa) |
Convenience form of SampleExtComputationInput() that takes an HdTimeSampleArray. | |
template<unsigned int CAPACITY> | |
void | SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, float startTime, float endTime, HdTimeSampleArray< VtValue, CAPACITY > *sa) |
Convenience form of SampleExtComputationInput() that takes an HdTimeSampleArray. | |
virtual HD_API void | PrimsAdded (const HdSceneIndexBase &sender, const AddedPrimEntries &entries)=0 |
A notification indicating prims have been added to the scene. | |
virtual HD_API void | PrimsRemoved (const HdSceneIndexBase &sender, const RemovedPrimEntries &entries)=0 |
A notification indicating prims have been removed from the scene. | |
virtual HD_API void | PrimsDirtied (const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries)=0 |
A notification indicating prim datasources have been invalidated. | |
virtual HD_API void | PrimsRenamed (const HdSceneIndexBase &sender, const RenamedPrimEntries &entries)=0 |
A notification indicating prims (and their descendants) have been renamed or reparented. | |
Public Member Functions inherited from TfWeakBase | |
TfWeakBase (const TfWeakBase &) | |
const TfWeakBase & | __GetTfWeakBase__ () const |
const TfWeakBase & | operator= (const TfWeakBase &) |
void | EnableNotification2 () const |
TF_API void const * | GetUniqueIdentifier () const |
Static Public Member Functions | |
static HdSceneIndexBaseRefPtr | AppendDefaultSceneFilters (HdSceneIndexBaseRefPtr inputSceneIndex, SdfPath const &delegateID) |
Returns the end of a scene index chain containing the filters necessary for input to an instance of this scene delegate. | |
Static Public Member Functions inherited from HdSceneIndexObserver | |
static HD_API void | ConvertPrimsRenamedToRemovedAndAdded (const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries, HdSceneIndexObserver::RemovedPrimEntries *outputRemovedEntries, HdSceneIndexObserver::AddedPrimEntries *outputAddedEntries) |
A utility for converting prims renamed messages into equivalent removed and added notices. | |
static HD_API void | ConvertPrimsRenamedToRemovedAndAdded (const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries, HdSceneIndexObserver *observer) |
A utility for converting prims renamed messages into equivalent removed and added notices at the observer level. | |
Additional Inherited Members | |
Public Types inherited from HdSceneIndexObserver | |
using | AddedPrimEntries = TfSmallVector< AddedPrimEntry, 16 > |
using | RemovedPrimEntries = TfSmallVector< RemovedPrimEntry, 16 > |
using | DirtiedPrimEntries = TfSmallVector< DirtiedPrimEntry, 16 > |
using | RenamedPrimEntries = TfSmallVector< RenamedPrimEntry, 16 > |
Protected Member Functions inherited from TfWeakBase | |
TfRefPtr< Tf_Remnant > | _Register () const |
template<class T > | |
TfRefPtr< Tf_Remnant > | _Register (T *tempRmnt) const |
bool | _HasRemnant () const |
Scene delegate which observes notices from an HdSceneIndex and applies them to an HdRenderIndex.
This serves as "back-end" emulation in order for scenes described via the HdSceneIndex/HdDataSource APIs to be accessible by legacy render delegates.
Definition at line 25 of file sceneIndexAdapterSceneDelegate.h.
|
static |
Returns the end of a scene index chain containing the filters necessary for input to an instance of this scene delegate.
Returns a named value.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Gets the topological curve data for a given prim.
Reimplemented from HdSceneDelegate.
Returns a single value for a given camera and parameter.
See HdCameraTokens for the list of paramters.
Reimplemented from HdSceneDelegate.
Returns the prim categories.
For instancer prims, the categories returned apply to all its instances.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the coordinate system bindings, or a nullptr if none are bound.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the cullstyle for the given prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the refinement level for the given prim in the range [0,8].
The refinement level indicates how many iterations to apply when subdividing subdivision surfaces or other refinable primitives.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the doubleSided state for the given prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns a single value for a given computation id and input token.
The token may be a computation input or a computation config parameter.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
For the given computation id, returns a list of computation input descriptors.
See HdExtComputationInputDecriptor
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the kernel source assigned to the computation at the path id.
If the string is empty the computation has no GPU kernel and the CPU callback should be used.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
For the given computation id, returns a list of computation output descriptors.
See HdExtComputationOutputDescriptor
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns a list of primvar names that should be bound to a generated output from an ExtComputation for the given prim id and interpolation mode.
Binding information is obtained through GetExtComputationPrimvarDesc() Returns a structure describing source information for a primvar that is bound to an ExtComputation. See HdExtComputationPrimvarDesc for the expected information to be returned.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
For the given computation id, returns a list of inputs which will be requested from the scene delegate using the Get() method.
See GetExtComputationInputDescriptors and GetExtComputationOutpuDescriptors for descriptions of other computation inputs and outputs.
Reimplemented from HdSceneDelegate.
Gets the axis aligned bounds of a prim.
The returned bounds are in the local space of the prim (transform is yet to be applied) and should contain the bounds of any child prims.
The returned bounds does not include any displacement that might occur as the result of running shaders on the prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns a named primvar value.
If *outIndices is not nullptr and the primvar has indices, it will return the unflattened primvar and set *outIndices to the primvar's associated indices, clearing the array if the primvar is not indexed.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the categories for each of the instances in the instancer.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Gets the extracted indices array of the prototype id used in the instancer.
example instances: 0, 1, 2, 3, 4, 5 protoypes: A, B, A, A, B, C
GetInstanceIndices(A) : [0, 2, 3] GetInstanceIndices(B) : [1, 4] GetInstanceIndices(C) : [5] GetInstanceIndices(D) : []
Reimplemented from HdSceneDelegate.
Returns the parent instancer of the given rprim or instancer.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns a list of prototypes of this instancer.
The intent is to let renderers cache instance indices by giving them a complete set of prims to call GetInstanceIndices(instancer, prototype) on. XXX: This is currently unused, but may be used in the future.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the instancer transform.
Reimplemented from HdSceneDelegate.
Reimplemented from HdSceneDelegate.
Returns the material ID bound to the rprim rprimId
.
Reimplemented from HdSceneDelegate.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Gets the topological mesh data for a given prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns descriptors for all primvars of the given interpolation type.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the allocation descriptor for a given render buffer prim.
Reimplemented from HdSceneDelegate.
Returns the render tag that will be used to bucket prims during render pass bucketing.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the authored repr (if any) for the given prim.
Reimplemented from HdSceneDelegate.
Returns the shading style for the given prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Gets the subdivision surface tags (sharpness, holes, etc).
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the object space transform, including all parent transforms.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Returns the authored visible state of the prim.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Requests the scene delegate run the ExtComputation with the given id.
The context contains the input values that delegate requested through GetExtComputationInputNames().
The scene delegate is expected to set each output identified by GetExtComputationOutputNames() on the context.
Hydra may invoke the computation on a different thread from what HdEngine::Execute() was called on. It may also invoke many computations in parallel.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Opportunity for the delegate to clean itself up after performing parallel work during sync phase.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
A notification indicating prims have been added to the scene.
The set of scene prims compiled from added/removed notices should match the set from a traversal based on sender.GetChildPrimNames
. Each prim has a path and type. It's possible for PrimsAdded
to be called for prims that already exist; in that case, observers should be sure to update the prim type, in case it changed, and resync the prim. This function is not expected to be threadsafe.
Implements HdSceneIndexObserver.
|
overridevirtual |
A notification indicating prim datasources have been invalidated.
This message is not considered hierarchical on primPath
; if /Path
is dirtied, /Path/child
is not necessarily dirtied. However datasource locators are considered hierarchical: if primvars
is dirtied on a prim, primvars/color
is considered dirtied as well. This function is not expected to be threadsafe.
Implements HdSceneIndexObserver.
|
overridevirtual |
A notification indicating prims have been removed from the scene.
Note that this message is considered hierarchical; if /Path
is removed, /Path/child
is considered removed as well. This function is not expected to be threadsafe.
Implements HdSceneIndexObserver.
|
overridevirtual |
A notification indicating prims (and their descendants) have been renamed or reparented.
This function is not expected to be threadsafe.
Implements HdSceneIndexObserver.
|
overridevirtual |
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Return up to maxSampleCount samples for a given computation id and input token.
The token may be a computation input or a computation config parameter. Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Reimplemented from HdSceneDelegate.
|
overridevirtual |
SamplePrimvar() for getting an unflattened primvar and its indices.
If *sampleIndices is not nullptr and the primvar has indices, it will return unflattened primvar samples in *sampleValues and the primvar's sampled indices in *sampleIndices, clearing the *sampleIndices array if the primvar is not indexed.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Store up to maxSampleCount transform samples in *sampleValues.
Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data. Sample times are relative to the scene delegate's current time.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Store up to maxSampleCount primvar samples in *samplesValues.
Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data.
Sample values that are array-valued will have a size described by the HdPrimvarDescriptor as applied to the toplogy.
For example, this means that a mesh that is fracturing over time will return samples with the same number of points; the number of points will change as the scene delegate is resynchronized to represent the scene at a time with different topology.
Sample times are relative to the scene delegate's current time.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Store up to maxSampleCount transform samples in *sampleValues.
Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data. Sample times are relative to the scene delegate's current time.
Reimplemented from HdSceneDelegate.
|
overridevirtual |
Synchronizes the delegate state for the given request vector.
Reimplemented from HdSceneDelegate.