Giter Site home page Giter Site logo

puchik / godot-extras Goto Github PK

View Code? Open in Web Editor NEW
129.0 129.0 15.0 89.36 MB

LOD and optimization C++ addons and shaders for Godot 4 and Godot 3

C++ 63.55% GDScript 10.44% GLSL 24.84% Python 1.16%
3d game-development gamedev godot godot-engine godotengine

godot-extras's People

Contributors

puchik avatar tokisangames avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

godot-extras's Issues

Linux and Mac support

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?

Multilod Crashes on load

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.

image

Win 10/64
Latest master, and the previous commit

Frustum culling for terrain shader?

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 :\

Objects not processing after scene changes, losing registration

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.

LODCommonFunctions::try_register(Object::cast_to<Node>(this), true);

Here you are removing their registration as soon as they leave the tree.

LODCommonFunctions::try_register(Object::cast_to<Node>(this), false);

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.

Support Shadow impostors

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.
image

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?

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.