Conversation
[Maven Build Status]📑 Commit: 📦 Download artifact: Generator.jar |
7caffd3 to
ec5103c
Compare
ec5103c to
b40423e
Compare
naulan-chrzaszcz
left a comment
There was a problem hiding this comment.
J'ai que des questions
|
Deux choses à vérifier suite à une présentation à Naulan :
|
| - `addMarginsTo`: Model types to add margins to (optional). | ||
|
|
||
| In order to perfectly stitch tiles together, rendering tasks may need to get a bit data overpassing the tile area/volume. This field indicates which model type(s) are concerned. This field could contain a single model type name or a list of model type names. |
There was a problem hiding this comment.
Est-ce qu'il faut preciser que cela ne fonctionnera pas avec les models de bâtiment ? et que ca fonctionne uniquement sur un model qui place des structures ?
There was a problem hiding this comment.
Alors, ça marchera pour tous les modèles, il n'y a pas de distinction. En revanche cela ne marchera pas pour toutes les marges effectivement. Seulement celles qui peuvent être déterminées avant de lancer les tâches.
Dans le cas des statistiques sur les heightmaps, et selon ce que l'on veut faire, il va falloir procéder autrement puisqu'il faut peut être appliquer des marges en fonction des modèles téléchargés.
| @Override | ||
| public WorldBBox3d placementMargins() { | ||
| return bbox; | ||
| } |
There was a problem hiding this comment.
Je me demande si c'est pas plus simple comme ca et enlever l'attribut bbox
| @Override | |
| public WorldBBox3d placementMargins() { | |
| return bbox; | |
| } | |
| @Override | |
| public WorldBBox3d placeableBBox() { | |
| return WorldBBox3d.surrounding(inside, borders); | |
| } |
There was a problem hiding this comment.
Ça fait un peu de calcul en moins de la stocker mais effectivement on peut s'en passer (c'est appelé une fois par tache x tuile x relation si je ne me trompe pas).
En revanche renommer placementMargins en placeableBBox risque d'être très confusant. Dans l'interface, il s'agit de renvoyer les marges à appliquer et cela peut être totalement indépendant des placeables (ça pourrait être autre chose).
There was a problem hiding this comment.
Je viens de voir, c'est utilisé à plusieurs endroits. Supprimer l'attribut va plutôt compliquer les choses (faire le calcul à deux endroits + le refaire plein de fois pour rien).
Changes
Add margins around heightmaps, models and voxelization area.
To make tile edges totally invisible, renderers need to know a bit about what's around current tile, in order to be able to draw things that overpass neighbor tile borders (placeable structures in particular).
Voxelization areas
Enlarging voxelization area is quite straightforward. The renderers know what they have to place and can enlarge voxelization area accordingly. They only needed that
Placeables tells what space they could take. Abboxmethod has been added for that toPlaceableinterface.Model fetch areas
To perform proper voxelization, model fetch area also needs to be enlarged according to renderer needs. For example, a rendrer placing trees needs to know about forest area near the edge of other tiles. It also needs to know about what altitude trees outside have to be placed.
This means that a renderer may add margins to several model types (in the above example : vegetation areas and altitude).
To manage that, a list of model type margins have been added to
Generation, to store all the needs. Margins don't add but they overlap. A list of model type volumes have also been added toGenerationTile. It stores actual needed volume per model type (this will be really useful for further development, see below).TileTaskParamshas a newAddMarginsTofield where can be told which model types should be enlarged according to the task needs.placementMarginsmethod has been added toTileTaskinterface to express that volume need as a 'margin' bounding box (margins the six +X/-X/+Y/-Y/+Z/-Z directions stored in a bounding box).Heightmap areas
Heightmaps may also need to overpass tile limits. This is the responsibility of task writing data to the heightmap to do that.
WritableHeightmapinterface have been modified so its now possible to increase its area, until some data is written.Showcase
Before the PR:

Some tree parts are missing around tile edge (in the middle of the image). Tile transition can be guessed.
After the PR:

No missing tree parts. Tile edge is totally invisible.
Next step
This PR makes it possible to create tasks enlarging model type volumes according to other already fetched models (typically buildings).
This is not included in this PR as it implies some more development (extra needed volume depends on vector feature voxelization and this may be complex).
--> It would be better to wait for #113 to be merged before developing something new on voxelizers.
TODOs
Self-checks
/docsfolder has been updateddocs/usage/Examples.mdwork the same (or have been adapted if subject to changes in this PR)