Repository navigation
[Reviewed] [Terrain 3D] Fix grass not placed inside a custom object - #2363
Merged
Merged
Conversation
…tom objects Layers of custom objects have no camera: grass inside a custom object was no longer placed, and terrains and scattered models were not updated with the distance to the camera. Also update the matrix of the camera before reading it, so that grass is placed around the camera on the first frame.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stacked on #2362 (targets its
terrain-updatebranch).Layers of custom objects have no Three.js camera, so
getThreeCamera()returnednullfor a terrain object placed inside another custom object. Since the lazy placement of #2362, grass in that case was not placed at all (it used to be placed, without distance fade).getCamera(object)helper, which walks up the custom objects containing the object and returns the camera of the scene layer of the outermost one.gdjs.CustomRuntimeObjectInstanceContaineris added to the allowedgdjsproperties of Terrain3D.Not covered: inside a custom object, grounds are still looked up with positions relative to the container, so grass only follows a terrain that is in the same custom object.
How to use it
No change for users.
Example project
None. Checks done:
3d-island-terrain: they differ from the expected images (6.57% and 9.49% of the pixels, blades at other positions over the same area), because of the per-chunk random numbers of Lazy grass placement to improve performance #2362. They are pixel-identical with and without this fix. The expected images of GDevelop-examples will need an update when the extension is updated there.AI usage