Code Monkey home page Code Monkey logo

Comments (4)

Zylann avatar Zylann commented on September 23, 2024 1

From reading the docs, I see that for teleporting objects (which is NOT what I'm doing, I SPAWN them but whatever xD) you could call reset_physics_interpolation. The bad news is, the plugin doesn't use nodes to render the chunks. It directly uses VisualServer. You'd think that this would give better control, with nothing in the way of simply rendering terrain. Nope! reset_physics_interpolation triggers changes in Spatial nodes (which I dont use), but also inside VisualInstance nodes (which I also don't use) and calls VisualServer.instance_reset_physics_interpolation, which... is not exposed in 3.5.

Turns out I reported this a while ago godotengine/godot#64905

There was a PR recently that finally exposed this stuff, but I didn't look into it because I'm no longer working in Godot 3. The function to call would be VisualServer.instance_set_interpolated, which is not present in 3.5.
However, it is present in 3.6.
If you can confirm that physics interpolation is indeed the cause, then you would have to patch the plugin in hterrain_chunk.gd and add this in _init:

vs.instance_set_interpolated(_mesh_instance, false)

In theory a more complete implementation would react to node notifications that come with this, but that feature isn't even present in Godot 4 and terrains are typically static so it's probably not worth it

from godot_heightmap_plugin.

Zylann avatar Zylann commented on September 23, 2024

If that was async shader compilation, the problem would be gone after a few seconds of gameplay, rather than constantly happening. All chunks use the same shader so that doesn't make sense. Even if it was caused by async shader compilation, there would be nothing I can do to prevent it, as it's something Godot does on its own.

Enable physics interpolation

I suspect this is the problem, and unfortunately I don't know how to workaround this because if I remember correctly it's something directly integrated into the renderer, and I can't find any API to add "exceptions" to it... it flickers like this the first time because chunks are pooled and when they spawn the renderer "thinks" that they moved from the origin of the world to where they spawn within 1 frame and applies some "smoothing" to the "movement", which would make sense for a rigid body, but somehow applies to terrain chunks which is completely wrong.

Also you're using a version I'm no longer maintaining.

from godot_heightmap_plugin.

Dadaskis avatar Dadaskis commented on September 23, 2024

Also you're using a version I'm no longer maintaining.

Yep! Just opening an issue because i couldn't find anything similar, i wouldn't ask you to support it, because, let's be real, who would really go back to ancient 3.x.. I'm using it because the project was started long ago and conversion isn't worth it, so for the most part i'm just trying to investigate it and, potentially, find a fix applicable for other users of the addon

the problem would be gone after a few seconds of gameplay, rather than constantly happening.

Weird. Basically, it happens once for each individual LOD variation as much as i've noticed it, but, yeah, it does seem to be not an issue with async shader compilation because it would use a fallback shader (but who knows, right)

but somehow applies to terrain chunks which is completely wrong.

Hmm, alright, i may take a look into internals of the addon. I did some modifications for this project so i hope i'll be able to make something.

And, yeah, sorry for bothering you with an older version, i'll close the issue as soon as i'll find a fix

Edit: Fixing tags

from godot_heightmap_plugin.

Dadaskis avatar Dadaskis commented on September 23, 2024

Thank you very much for answering all my questions, i'm going to wait for 3.6. and apply it as soon as it comes out. I'm going to close the issue because i'm pretty sure that will fix it!

Edit: Sorry for not clarifying, but i can confirm, that is a problem of physics interpolation and it is not related to async shader mode in any way

from godot_heightmap_plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.