Chunk Visualizer
This kind of components allow Infinite Lands to generate your own chunk. You can create your own component by implementing the interface IVisualizeTerrain.
Shared
- Mesh Settings
- Terrain Generator
- Chunk Loader
- Draw Chunks: Draws gizmos related to the bounds of the chunk generated
Single Chunk Visualizer
Component to Visualize a Single chunk, directly from the editor, for quick iteration and terrain modification.
- Show Timings: Allows to debug to see the time taken to generate a chunk.
I change things and nothing happens
In case the mesh doesn’t auto-update with the changes, you can click on the “Sync & Reload” button to reload the mesh manually.
Infinite Chunk Visualizer
Component to visualize a bunch of chunks in a QuadTree LOD system.
- Camera: Used to apply Frustrum Culling to the diferent chunks.
- Player: Reference point to where the center of generation should be.
- Generation Mode: Which chunks should be generated first.
- Decimated Mesh for Non Close: Uses the Mesh Type of decimated mesh when the chunks are further away of the player. Can reduce poly count and increase framerates for barely any visual difference.
- Generation Distance: Max distance to where chunks will be generated. With that setting and the small chunk settings mesh scale, it will calculate the number of quadtree levels to generate, the sizes of each and generate accordingly.
- Max Chunks Per Frame: How many chunks to generate in parallel.
- Ground Layer: Layer to apply to the generated chunks.
Chunk Data Processors
This components are responsible to process an asset or data generated by the visualizer.
Vegetation Renderer
Process assets of type IHoldVegetation. Will allow vegetation to appear on scene.
Configuration
- Render in Layers: Which rendering layers should be used to render the vegetation? It will be used to know which cameras to fetch and therefore render the vegetation through them.
- Max Rendering Distance: Optional value to set a max globla rendering distance. If set to -1 it will use the value of each asset, weather a higher value than that will set a maximum value to all assets.
- Density Per Size: This value represents the maximum size of the chunk in relation to the density. 1000 means that it will allocate space for a chunk of size 1000x1000 when the density is 1, and use space of 500x500 when the density is 0.5;
- Render Vegetation: Should the vegetation be rendered?
Displacement (ONLY FOR BUILT-IN)
- Displace with movement: If enabled, a displacement texture will be created. This one can be sampled in a shader to make objects move according to outside factors. Via the use of a particle system with the specified material, the displacer will get the particles on the screen and pass them down to the shader.
- Cull Mask: The mask where the particles for the displacement texture are.
- Displace Distance: How much distance from the player do you want to visualizer the displacement
- Visualize On Display: Should it render the displacement to the screen? (For debugging purposes)
An example can be found with the grass shader, where when moving around, the grass will receive the interaction and move with the player.
Terrain Painter
Process assets of type IHoldTextures. Will apply the necessary texturing to the terrain, while providing the data to the vegetation system for a nice blend between the terrain and the vegetation.
- Terrain Material: Which material should be used to to the mesh?
By default, Procedural painting will be used, however you can click on any of the buttons that are provided to load a diferent mask into the terrain.
Mesh Maker
Processes the chunk data to generate the required Mesh.
- Max Meshes per Frame: How many meshes can be processed at the same time in a single frame
- Max LOD with Physics: Which lod value should start containing colliders? Value of 0 means that only the highest of detail lod value will contain physics while a value of 10 could potentially mean that all meshes will contain colliders.
Point Store
The point store processes chunk data so that it keeps track of which meshes are generated and specifically generates the necessary Coordinate Data.
- Player: Transform that represents the player so that other components can make use of it.
The methods available are:
- GetMeshRequestAtPosition(Vector3 position): Returns a MeshRequestResult object at that Vector2 position (should be introduced in local space).
- GetCoordinateData(Vector3 position): Returns a CoordinateData struct in that position.
Chunk Control
These components manage how the chunks are generated and releated to each other. Currently there are two types of chunks controllers provided.
- Single Chunk: Used by default in the Single Chunk Visualizer, will just request one chunk of a specific LOD and load it up accordingly. Can be used in the Inifnite Chunk Visualizer to create a grid like generation, where all the chunks are the same
- Quad Chunk: Used by default in Infinite Chunk Visualizer. Creates a quad-tree LOD system such as we can get the maximum rendering distance while keeping it fast and efficient.