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 LoD hysteresis #6375

Closed
MatthewsSam opened this issue Sep 2, 2016 · 17 comments
Closed

Add LoD hysteresis #6375

MatthewsSam opened this issue Sep 2, 2016 · 17 comments

Comments

@MatthewsSam
Copy link

Hi, after posting on the forum people suggested me to post here.

Here is my suggestion for an implementation of the first part in Godot Engine (I will do another ticket for the smooth transition)

  1. Add an hysteresis, which means when you trigger a LoD change, to trigger it back to it's previous state you must go to a bigger distance
    For instance if we have a sphere that appears at 10 unit, to make it disappears, the player must go at ~13 units. This reduce the number of unwanted change.
    That could be done automatically with a fixed constant directly in the engine (something like 5 or 3) or with an option in the global project setting. Putting this on a per node basis would be IMHO a vast of time and potentially confusing (if offsets aren't the same across all mesh of the same object it can cause problems).

In the global editor setting there would be simply an option LoD Hysteresis: and by default it would be at 0 (= no effect).

If devs are interested I can try to submit a patch :)

Sam

@reduz
Copy link
Member

reduz commented Sep 2, 2016

ah nice, lets take note of this for 3.0

On Fri, Sep 2, 2016 at 2:28 PM, samuncle [email protected] wrote:

Hi, after posting on the forum
https://godotdevelopers.org/forum/discussion/comment/17817 people
suggested me to post here.

Here is my suggestion for an implementation of the first part in Godot
Engine (I will do another ticket for the smooth transition)

  1. Add an hysteresis, which means when you trigger a LoD change, to
    trigger it back to it's previous state you must go to a bigger distance
    For instance if we have a sphere that appears at 10 unit, to make it
    disappears, the player must go at ~13 units. This reduce the number of
    unwanted change.
    That could be done automatically with a fixed constant directly in the
    engine (something like 5 or 3) or with an option in the global project
    setting. Putting this on a per node basis would be IMHO a vast of time and
    potentially confusing (if offsets aren't the same across all mesh of the
    same object it can cause problems).

In the global editor setting there would be simply an option LoD
Hysteresis: and by default it would be at 0 (= no effect).

If devs are interested I can try to submit a patch :)

Sam


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#6375, or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z27yg8mlbqwoLJq5uJax3W_XBJmxjks5qmFzWgaJpZM4Jz7Dr
.

@Zylann
Copy link
Contributor

Zylann commented Sep 2, 2016

Does Godot handle LoD at all currently?

@SuperUserNameMan
Copy link
Contributor

@Zylann : through GeometryInstance.set_draw_range_begin/end()

@Zylann
Copy link
Contributor

Zylann commented Sep 2, 2016

Oh. That means you need to create a MeshInstance for every LoD of a mesh for example?

I am still wondering how a chunked terrain node would perform with this, as the LoD in use depends on the LoD of neighbor chunks to avoid seams (but maybe it's a different issue).

Also, please consider multi-camera (split-screen, mirrors...) and VR when implementing LoD with hysteresis, as it may require to render different LoDs.

@nunodonato
Copy link
Contributor

I see the hysteresis properties in the current master. Is it safe to close this?

@reduz
Copy link
Member

reduz commented Aug 5, 2017

this feature is a ton more difficult to implement than I initially thought, specially if your scene is being rendered by multiple cameras. if you can think of an algorithm to get it to work in that situation, let me know

@reduz
Copy link
Member

reduz commented Aug 8, 2017

will kick to 3.1 for now, will properly implement all the lod systems there

@reduz reduz modified the milestones: 3.1, 3.0 Aug 8, 2017
@Zireael07
Copy link
Contributor

So why have the hysteresis property displayed in editor if it's not used?

@reduz
Copy link
Member

reduz commented Aug 8, 2017

@Zireael07 because the API is exposed, but the implementation is not written. Might be a good idea to hide it for the time being. Also it might probably be implemented different at some point

@volzhs
Copy link
Contributor

volzhs commented Dec 26, 2017

@reduz probably should hide Hysteresis before RC1?
also, just LOD doesn't work I think either for now.

@ghost
Copy link

ghost commented Apr 6, 2018

Still reproducible/relevant in 3.1 master 9ad1800 : VSScene::instance_geometry_set_draw_range does nothing. (Apparently it's planned for 3.1 but I think it's crucial to put in the docs that it's not yet implemented)

@akien-mga
Copy link
Member

Moving to the next milestone as 3.1 is now feature frozen.

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Sep 15, 2018
@MysteryGM
Copy link

Hi. The LOD system in Godot doesn't work at all, unless I am maybe doing something wrong?
I considered making the LOD system myself, that way I can also batch lower LODs etc, maybe I will do Hysteresis but I am not too good with shaders.

So what I am wondering is how far is the developers with the LOD system?
If I make the LOD system using GDscript will the Godot engine developers be able to integrate it into the engine?

Is GDscript slower than integration? Because if it isn't I could always make it as an addon.

Windfisch added a commit to Windfisch/godot that referenced this issue Nov 19, 2018
Windfisch added a commit to Windfisch/godot that referenced this issue Nov 19, 2018
@Calinou Calinou modified the milestones: 3.2, 4.0 Aug 21, 2019
@akien-mga
Copy link
Member

Superseded by godotengine/godot-proposals#692.

@Norrox
Copy link
Contributor

Norrox commented Nov 21, 2023

Is this an issue again? It's visible in the editor

@AThousandShips
Copy link
Member

Please open a new issue and provide the details as well as a reproduction project

@Calinou
Copy link
Member

Calinou commented Nov 22, 2023

This is already implemented in 4.x: https://docs.godotengine.org/en/latest/tutorials/3d/visibility_ranges.html (Ctrl + F for hysteresis)

For 3.x, see #53778.

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

No branches or pull requests