Skip to content
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

Question: Attatch to moving object? #183

Open
Slluxx opened this issue Jan 18, 2024 · 2 comments
Open

Question: Attatch to moving object? #183

Slluxx opened this issue Jan 18, 2024 · 2 comments

Comments

@Slluxx
Copy link

Slluxx commented Jan 18, 2024

I am really sorry if this question has been asked or documented somewhere.

I would just like to know if its possible to attatch it to a moving node so the generation always happens in a fixed region around whatever it is attached to (for example a player). It would be awesome to generate grass in this way so that the generated blades stay at the same position in global space. If its then possible to have a list or flags attatched to nodes to white or blacklist generation on certain objects, it would be truly amazing. I think this could be extended to use a seed to generate the same grass at the same position, without saving any spawn positions.

I know there are a lot of limitations on GPU instancing so please forgive me if i am totally mistaken.

This is an awesome addon nonetheless and i am glad it exists!

@florianvazelle
Copy link
Contributor

I don't think it's possible, you can define a seed but it's not based on the position of the scatter node.
The scatter node inherits from a Node3D, so you can attach it to another moving node, you have to play with the "force update" setting or other parameters, but it's not very efficient.

Actually, you can easily create a large scatter node and apply a visibility range to the scatter item, to make the element appear only around the camera.

@Slluxx
Copy link
Author

Slluxx commented Jan 19, 2024

Maybe, yeah. I am just slightly confused by a few things. For example i thought that gpu instanced objects can only be culled if none of the objects are on screen anymore. However i am getting better fps the the less grass i have on screen (from the same scatter node). Am i just misstaken? Is the gpu instancing working? And how could i check that myself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants