Azure / azure-remote-rendering

SDK and samples for Azure Remote Rendering
MIT License
106 stars 38 forks source link

[Remote rendering problem] Allow easily changing opacity for individual models #80

Open WouwWatts opened 2 years ago

WouwWatts commented 2 years ago

Currently changing opacity is easiest done using ShellRendering (but this is universal for all models with the Hierarchical State Override). So you cannot give different models a different opacity.

It would be lovely if you could simply change the opacity of a model on a model basis, without having to sync all children, and loop over them to loop over all meshes, to loop over all materials, to change the opacity. Which is, performance wise, impossible with large models.

If there is something obvious I am missing, please let me know.

jakrams commented 2 years ago

Hey @WouwWatts did you have a look at hierarchical state overrides. I think that's exactly what you are looking for.

WouwWatts commented 2 years ago

If I'm not mistaken, you can not have different opacity values on different models at the same time using the hierarchical state override, right?

jakrams commented 2 years ago

Indeed, as far as I can see this is currently not possible. I'll forward the request to the team for consideration.

Btw. the workaround that you mentioned (to loop over all materials) may not work either, because identical materials are usually shared across many pieces of the model and thus changing a material on mesh A may change it for mesh B as well, which might not be what you want. You can disable material deduplication during object conversion, but as you already mentioned the performance cost for the iteration may be too much.

FlorianBorn71 commented 2 years ago

Hi @WouwWatts, thanks for this suggestion! Agreed that changing materials does not scale well, that's why we introduced the hierarchical state override in the first place.

I have some follow-up questions regarding your request.

1) At the beginning you mentioned the "Shell rendering" feature. Is that the feature you'd like to be extended with individual opacity levels? Note that for shell rendering you can only see the outermost shell and not the inner parts at (potentially) distinct transparency levels. That would rather be the "see-through" mode. The reason why I bring up this distinction is that "see through" uses a quite sophisticated rendering technique that would make it pretty complicated to add per part opacities. For shell rendering it would be easier. 2) The hierarchical state override component would be the very natural API entry point, so this question is more for completeness: Do you need a distinct level per part (existing state override), or per full model (API does not exist yet)?

Thanks! Florian

WouwWatts commented 2 years ago

I would like to be able to easily change the opacity from an entire model, but on a model per model basis. (have one model be 80% transparent, one 65% , and another 100%, for example). Exactly how it works for the Hierarchical Override, but on a model basis, instead of a global one.

Thanks!

FlorianBorn71 commented 2 years ago

Thanks for additional information, @WouwWatts!

Now the important question: Would you need it for "Shell" rendering mode or for "See-through"? See comparison screenshots here: https://docs.microsoft.com/azure/remote-rendering/overview/features/override-hierarchical-state

Technically this makes a huge difference to the complexity of the implementation.

Cheers, Florian

WouwWatts commented 2 years ago

I am sorry, I wasn't very clear, I mean the Shell Rendering.

FlorianBorn71 commented 2 years ago

Thanks, I've added this to our feature backlog, but I cannot give an ETA right now. Florian