Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 3D visibility ranges (HLOD) demo #860

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Feb 26, 2023

This demo showcases how to set up a hierarchical LOD system using visibility ranges.

This can improve performance significantly in 3D scenes by reducing the number of draw calls and polygons that have to be drawn every frame.

Use WASD or arrow keys to move, and use the mouse to look around. Press L to toggle the use of visibility ranges. Press F to toggle the fade mode between transparency (the default in this demo) and hysteresis (which is slightly faster, but results in more jarring transitions).

Note

Performance is expected to decrease significantly after disabling visibility ranges, as all trees will be drawn with full detail regardless of distance.

Preview

visibility_ranges webp

@Calinou Calinou force-pushed the add-visibility-ranges-demo branch from 1fd69d3 to a61a396 Compare February 26, 2023 18:42
@akien-mga akien-mga changed the base branch from 4.0-dev to master February 28, 2023 17:40
@Calinou Calinou force-pushed the add-visibility-ranges-demo branch 2 times, most recently from 2b24df4 to bf05a14 Compare March 8, 2023 17:51
@Calinou Calinou force-pushed the add-visibility-ranges-demo branch from bf05a14 to fd4b914 Compare March 8, 2023 17:51
@jtnicholl
Copy link
Contributor

I think it would be good to also demonstrate what the visibility_parent option does, and how to use it.

@Calinou
Copy link
Member Author

Calinou commented Jul 7, 2023

I think it would be good to also demonstrate what the visibility_parent option does, and how to use it.

I'm not sure how it should be used exactly. For instance, I don't really understand why you need visibility_parent when you can just hide and show child nodes as I did. There's surely a good reason it was implemented by @JFonS, I could never grasp exactly why though.

@JFonS
Copy link

JFonS commented Jul 7, 2023

visibility_parent can be used to automatically show/hide instances based on whether the lower LOD levels are visible. This way you can control lower levels with visibility ranges and the higher levels will only show when needed.

Here I found one of the test scenes I used while testing my PR, it shows how the setup works with three LOD levels:
LOD_test.tar.gz

@Calinou
Copy link
Member Author

Calinou commented Oct 18, 2023

I've gotten Visibility Parent to work locally, but this prevents fading from working at all in the demo, unfortunately. This occurs both with the Self and Dependencies fade modes, and even if Visibility Range End is set to a value greater than 0 in the high-detail object. I'd prefer keeping the fading as it helps reduce visible pop-in a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants