Level of detail

Richard Bair richard.bair at oracle.com
Mon Jul 29 14:12:48 PDT 2013

> The concept of Level of detail was recently brought up.  I believe it was
> referring to 3D, but the concept applies to 2D as well, when we have the
> concept of 2D scaling ("zoom")

This is a great point.

> Is there a current plan to address this?

I don't think so (at least I have not been part of any conversations), other than knowing something needs to be done at some point.

> Is there a current technique that can be used to get something close?

WIth application knowledge I would imagine so.

> For example, the two use cases I have right now:
> If I have a lot of Text nodes and they become unreadable when zoomed out,
> is there a way I could have them fade out and not cost me layout and
> rendering time?

I don't know the way the app is written but you could change opacity of text as the zoom level increases?

> If I have an image that is rendered from SVG data and used in multiple
> places in the scene graph.  I want to update it if the user changes the
> zoom level so that it isn't blocky, or replace it with the vector graphics
> used to render it if the user zooms in so much that the image size would be
> ridiculous.

I don't have any good ideas here. Maybe one of our 3D experts can tell us how this is typically handled in 3D.

> I can't think of a reasonably easy way to implement those cases.
> I'm thinking of some new kind of Pane that is sensitive to the size that it
> will finally be rendered at.  It could be used to hide or replace it's
> children based on the final bounds it will have on screen.

A different way to handle this is to be able to annotate a node (or a PathElement) with LOD information, and let the renderer know what to do with stuff that falls out of that LOD. But really it is more than just the renderer, it is also layout & bounds & CSS & picking such too, I would guess. If something fails the LOD check, it seems it should be skipped on any related to layout / visuals. You still want it to show up for #lookup I would guess.


More information about the openjfx-dev mailing list