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

Query mesh terrain to determine layer weights. #242

Closed
zwcloud opened this issue Jun 4, 2022 · 0 comments
Closed

Query mesh terrain to determine layer weights. #242

zwcloud opened this issue Jun 4, 2022 · 0 comments
Labels
enhancement New feature or request runtime issues happened when the game is running
Projects

Comments

@zwcloud
Copy link
Owner

zwcloud commented Jun 4, 2022

requested by several users

  1. Convert world position (x,z) to uv coordinate (u,v) normalized in a mesh-terrain
    • CPU way: normalize world position with world AABB of a mesh-terrain to a uv of the weight-map, then sample the weight-map with the uv to get layer-weights
    • GPU way: raycast to get the world position's RaycastHit.textureCoord, then draw a pixel with the uv and a shader that output layer weights instead of weight-blended color.
  2. Sample the weight-map(s) with (u,v) and get per-layer weight
@zwcloud zwcloud added enhancement New feature or request runtime issues happened when the game is running labels Jun 4, 2022
@zwcloud zwcloud added this to To do in Mesh Terrain Editor 4 Jun 4, 2022
@zwcloud zwcloud removed this from To do in Mesh Terrain Editor 4 Jul 8, 2022
@zwcloud zwcloud added this to To do in 4.1.0 via automation Jul 8, 2022
@zwcloud zwcloud closed this as completed Aug 3, 2022
4.1.0 automation moved this from To do to Done Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request runtime issues happened when the game is running
Projects
4.1.0
Done
Development

No branches or pull requests

1 participant