-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Implement Lod range #20489
Implement Lod range #20489
Conversation
Could you squash commits together? See PR workflow. |
There are also some style issues with operator-aligned assignments, see https://travis-ci.org/godotengine/godot/jobs/408598091 and Style guide. |
Thank you for your feedback! (And sorry for not reading these documents beforehand) |
While playing around, I got the following godot crash which I can't reproduce, neither in release nor debug mode: To me it looks unrelated to my patch, but what's your opinion on this?
|
Yeah the backtrace doesn't seem related to your changes. We merged a lot of patches over the last 3 days so there might be some new bugs in the master branch. |
The crash sounds like #20451. |
This seems to work for me, although the shadow still gets drawn even if the mesh isnt... |
yes, shadows probably need more thinking; should a high-detail-model be selected if the light's camera is close to the object, or if the main viewport's camera (which is the main camera in scenarios with multiple viewports/cameras?)? How to deal with directional lights. But I guess it would be a good idea if only those meshes draw a shadow that are actually drawn by the camera. |
I think it is acceptable that shadows are generated based on the high poly mesh to be honest, in most scenario's it creates the most expected result. |
If the purpose of |
b8ea182
to
40074ca
Compare
I've updated it to support hysteresis with multiple cameras as follows: This has (almost) no overhead when LOD is not used at all, because all the map lookups are only made for objects that have a LOD range set. |
Unfortunately, objects which are LOD-culled away still seem to cast shadows; why is this? |
Discussed this with @reduz on IRC:
As such, moving to the 3.2 milestone (might end up as 4.0 depending on whether or not it's bound to the Vulkan implementation). |
This is being implemented in a different way in 4.0 branch, so closing this PR. Still thanks for the effort! |
This implements the lod_max_distance / lod_min_distance and hysteresis of
GeometryInstance