ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Transparency input for all MultiBody visualizers

Open anotheruserofgithub opened this issue 3 years ago • 9 comments

Feature Request

There are use cases where it could be great to be able to change the transparency of any visualizers in the animation window. For instance, OMEdit allows to do that through a context menu (see openmodelica/openmodelica#9083), but this has to be done each time you simulate the model as the values are not persisted. Instead, it would be very useful to have a parameter, or even a time-varying input, that can be set in the model directly. Surface already has that, but not Shape nor Vector, while I do not see what could prevent them from having such a feature. They all have a color, so why not a transparency?

anotheruserofgithub avatar Jun 10 '22 19:06 anotheruserofgithub

Historically one major reason is that transparency for multiple object is problematic; both in terms of what it implies (what happens if you split an object into two - will that be less transparent?) and in terms of implementation (ideally special shaders, depth peeling, OIT-variants).

Making one object transparent in a way that sort of works is trivial in comparison.

HansOlsson avatar Jun 12 '22 18:06 HansOlsson

I'm new to this topic and didn't know it was so difficult. Thank you very much for the answer and the depth peeling / OIT pointers!

anotheruserofgithub avatar Jun 12 '22 22:06 anotheruserofgithub

@HansOlsson If I understand correctly, the thing is the ambiguous definition of "transparency".

tobolar avatar Jun 22 '22 09:06 tobolar

@HansOlsson If I understand correctly, the thing is the ambiguous definition of "transparency".

There are two factors - it's ambiguous and it's difficult to implement in a good way.

HansOlsson avatar Jun 22 '22 09:06 HansOlsson

Yet, why does Surface have a transparency input, then? Should it not be removed to be consistent across visualizers? Sorry but I forgot to ask the question earlier.

If it is kept, it would be a slight improvement to modify the documentation: "Transparency of surface" instead of "Transparency of shape", not only in PartialSurface but in all models that make use of Surface (Rectangle, Torus, PipeWithScalarField).

anotheruserofgithub avatar Jun 22 '22 12:06 anotheruserofgithub

@HansOlsson Would you have an answer? (Sorry for asking late.)

anotheruserofgithub avatar Jun 25 '22 09:06 anotheruserofgithub

Yet, why does Surface have a transparency input, then? Should it not be removed to be consistent across visualizers? Sorry but I forgot to ask the question earlier.

Removing things is a difficult task as some might use it.

Especially as if it is only one Surface it should work. (Well, only one surface visible per pixel; so you could have a non-overlapping set of surfaces as well).

If it is kept, it would be a slight improvement to modify the documentation: "Transparency of surface" instead of "Transparency of shape", not only in PartialSurface but in all models that make use of Surface (Rectangle, Torus, PipeWithScalarField).

Making clear that it only work for Surface and possibly having it in the correct class would be good.

HansOlsson avatar Jun 27 '22 07:06 HansOlsson

Removing things is a difficult task as some might use it.

Especially as if it is only one Surface it should work. (Well, only one surface visible per pixel; so you could have a non-overlapping set of surfaces as well).

Understood, thanks! :)

anotheruserofgithub avatar Jun 27 '22 08:06 anotheruserofgithub

Reopened, since documentation shall be improved.

tobolar avatar Jun 27 '22 15:06 tobolar