Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
1.0.0:terrain [2023/02/23 16:27] – [Creating an individual procedural terrain algorithm] admin | 1.0.0:terrain [2023/02/23 16:47] (current) – [Configuration] admin | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== DesignTime ===== | ===== DesignTime ===== | ||
+ | |||
+ | You can generate a terrain at design time by different ways. | ||
+ | |||
+ | ==== From Heightmap ==== | ||
+ | |||
+ | - Drop a TGorillaTerrain component onto your GorillaViewport | ||
+ | - Select the TGorillaTerrain instance | ||
+ | - Go to " | ||
+ | - Open the editor dialog and load a 2D image from file | ||
+ | - The heightmap will be stored inside the IDE formular file (*.fmx) | ||
+ | |||
+ | ==== Autogenerate with Editor ==== | ||
+ | |||
+ | When you select your TGorillaTerrain component in structure view of the IDE, you can right click onto and a popup will show. | ||
+ | |||
+ | Here you can select between the embedded procedural terrain generation algorithms. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Choose one of the " | ||
+ | |||
+ | After you have clicked, you need to click into the viewport in your form to refresh rendering. | ||
+ | |||
+ | ==== Planting ==== | ||
+ | |||
+ | The framework brings you a great feature called " | ||
+ | |||
+ | After you have loaded a terrain from heightmap or by procedural generation, you can use this functionality. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | It will need another TGorillaModel component as template and will perform an instancing onto the selected terrain. | ||
+ | |||
+ | This means all instances will automatically be adjusted to the shape of the terrain. | ||
+ | |||
+ | When clicking the " | ||
+ | |||
+ | {{: | ||
+ | |||
+ | === Configuration === | ||
+ | |||
+ | The algorithm will create instances for all meshes inside the selected template / source model. | ||
+ | |||
+ | Basically the algorithm splits the terrain into cells for more realistic placement. | ||
+ | |||
+ | ^Setting ^ Description ^ | ||
+ | |Clear Instances | Clears all previously available instances in the source. | | ||
+ | |Minimum Scale | If " | ||
+ | |Instance Scale | A basis scaling of each instance (will be multiplied with source scale if "Apply Source Transformation" | ||
+ | |Space | Adjustment between cell-center and source size. | | ||
+ | |Padding | Increasing this value will compress cells for planting. Objects will be placed closer together.| | ||
+ | |Random Y-Rotation | This is not suitable for all kind of source models. Depending on the internal transformation of submeshes. | | ||
+ | |Random Scaling |This will randomly scale instances with limitations given by " | ||
+ | |Apply Random Grid-Offset|Terrain is splitted into equal size grid cells. To produce a more realistic look, you can add some random offset to the cell-center.| | ||
+ | |Apply Source Transformation|It will apply the transformation of the owner model. This is not suitable for all kind of models, depending on the internal transformation of submeshes.| | ||
+ | |Count |The number of instances that should be created. This should be adjusted to the GPU you are using and the outcome you expect.| | ||
+ | |||
+ | === Source Models === | ||
+ | |||
+ | The planting algorithm is straight forward and treats all submeshes inside the source model equaly on creating instances. | ||
+ | |||
+ | Therefore it can produce unexpected results. | ||
+ | |||
+ | The source model should contain a flat hierarchy without or less transformation of sub-meshes. | ||
+ | |||
+ | __NOTICE:__ The applied instance transformation is absolute and not relative to the source model! | ||
===== Runtime ===== | ===== Runtime ===== | ||