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

Generation on top of mesh #79

Open
EmiOnGit opened this issue Mar 8, 2024 · 0 comments
Open

Generation on top of mesh #79

EmiOnGit opened this issue Mar 8, 2024 · 0 comments

Comments

@EmiOnGit
Copy link
Owner

EmiOnGit commented Mar 8, 2024

What problem does this solve or what need does it fill?

Currently, the grass placement is inspired by the pipeline used from Horizon dawn
see https://gdcvault.com/play/1024120/GPU-Based-Run-Time-Procedural
However, I found the approach of seperating xy Positions from the z of the blades rather cumbersome and not approachable.
The biggest drawback of their approach is that sampling from a ground mesh is not easily implementable.

Describe the solution you'd like

I would like to have a ground mesh for the grass. The density map is further placed on the UV-texture of the ground mesh.
The new pipeline would be:

  1. Compute u,v coords of grass blades by dithering the density map
  2. Compute (x,y,z) coords of the grass blades by sampling from the ground mesh
  3. Store all (x,y,z) coords on the cpu
  4. Load into grass pipeline

I believe that all those steps can be computed in a compute shader

Describe what is for debate

The exact structure of the ground mesh is not totally obvious to me currently. As I see it now, each chunk would need its own ground mesh.
AFAIK Unity uses a single mesh which can be loaded in partially as needed. I'm not totally sure how they do it though

Additional context

I've seen that https://github.com/jadedbay/bevy_procedural_grass/
Also samples the grass from a mesh. Maybe look into their solution

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

1 participant