puchik / godot-extras Goto Github PK
View Code? Open in Web Editor NEWLOD and optimization C++ addons and shaders for Godot 4 and Godot 3
LOD and optimization C++ addons and shaders for Godot 4 and Godot 3
Is it possible to save the splatmap after finishing up blending?
[LOD ADDON]
I did some tests inside a slightly modified scene from the one provided and the results are as following:
Avg FPS: with 4LODs (lod3=billboard, optimized materials, etc) from far away = 570
Avg FPS with default godot lod, lod0 material mesh from far away = 820
Pros of using this addon are that you have more control over the LODs.
Cons for using this addon is 250 frame drop.
I do think my test is flawed. Can someone confirm/infirm this?
On my game I have a global camera, as well as the global MTLOD/LodManager. When switching back and forth between scenes, some previously instantiated assets are removed from the tree and get added again. This causes them to stop changing LODs. Neither the LODManager nor the camera have changed or been removed from the tree, only the assets. Though my previous design did remove and add different cameras upon scene changes.
If I specify print("Setting camera: ", LodManager.set_camera(path_to_my_camera))
upon scene loads I get true, and during the first scene load, the LODs change on the assets as without this line. However, upon disconnecting and reconnecting the scene (assets remain instantiated), they stop changing LODs, even though I specify set_camera in _enter_tree() as soon as the scene loads. set_up_camera
does the same thing.
It looks like you are registering objects with LodManager in _ready()
instead of _enter_tree()
, though I think it belongs in the latter or both.
godot-extras/gdnative/multi-lod/src/lod.cpp
Line 133 in 24f8d74
Here you are removing their registration as soon as they leave the tree.
Adding and removing objects from the tree is the primary way for levels to be loaded or objects streamed in and out, so they need to register on _enter_tree
.
I've experimented with Multilod a bit. I have a tree with a mesh as LOD0 and a billboard as LOD1. When it works, it does so just fine. However on two separate occasions, I've come back to my project on a subsequent day, it loads in the editor but when I run the game it crashes almost instantly on startup. I have to disable the plugin to run my game. Running the game through various versions 3.2.1, 3.2.3, 3.2.4rc all exhibit the same symptom.
When it happened the first time, I stopped using it for a while to focus on other things. 1-2 weeks later I came back, got the new version, and again am experiencing the same thing. It was fine last night. I haven't changed anything with the multilod or the object and have been working on other things. Now all of a sudden it isn't fine.
When I run godot 3.2.4rc through the MSVC debugger it shows lod.dll throws an exception error in nativescript. Though my game takes about 25 seconds to load, including to get the scene actually using multilod to _ready(). However the game crashes with this exception error within the first second of loading.
Win 10/64
Latest master, and the previous commit
I'm planning on using shadow impostors and will likely patch this plugin to do so. I'd like to discuss whether you want it in your repo and how it should be implemented.
Here is what shadow impostors are:
https://www.reddit.com/r/godot/comments/i2j45k/quick_tip_shadow_impostors_and_vertex_count/
Here are the performance benefits from one tree. If you switch to orthogonal shadows you get an even bigger reduction for hardly any visual difference.
To implement it, I could:
Provide a MTLOD user setting for the shadow impostor LOD: LODX. Then disable shadow casing on all LODs 0 to X-1, and leave LODX always visible and shadow only. When switching to LODX, instead of changing visibility, we just change shadow casting to normal instead of shadow only.
Instead of patching MTLOD, write a script that connects to children LOD visibility signals and adjust the settings from there. However, this means maybe 3 extra signal connections and gdscript function calls for hundreds or thousands of objects, when it could be done in C++.
What do you think?
Hi, I noticed that the compiled project uses lod.dll file. Just want to ask, is the project platform agnostic or is there platform specific code?
Hi. I'm using your terrain shader (thanks!) and I seem to have an issue with incorrect frustum culling?
Apologize if this does not pertain to your shader, but I'm really stuck here, hehe :D
I tried using mesh.custom_aabb = AABB() and put some really large values in there but it doesn't seem to affect it :\
I successfully compiled this lod plugin for android!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.