# Switching material purpose

**URL:** <https://forum.aousd.org/t/switching-material-purpose/1578>\
**Category:** Hydra\
**Tags:** rendering\
**Created:** [June 4, 2024, 1:52pm UTC](https://forum.aousd.org/t/switching-material-purpose/1578 "2024-06-04T13:52:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjeziorski](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jjeziorski](https://forum.aousd.org/u/jjeziorski)\
**Post date:** [June 4, 2024, 1:52pm UTC](https://forum.aousd.org/t/switching-material-purpose/1578/1 "2024-06-04T13:52:26Z")

</div>

Hello,  
Is there a way to switch in runtime between material purposes (preview and full) when implementing Hydra delegate?

We’ve setup purpose selection via `HdRenderDelegate::SetRenderSetting` and it is broadcast via `HdRenderDelegate::GetMaterialBindingPurpose`. We’re also marking `DirtyMaterialId` for Rprims to propagate material changes. However, it only seems to work with the very first value that was returned. This seems consistent with `UsdImagingDelegate` querying render delegate only in constructor. This effectively prevents from switching material purposes during runtime.

Is this intended behavior? We’d find it useful to select material purpose based on department needs and switch between them on demand. Is there anything we’re missing?
