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.

Single Chunk Visualizer

Infinite Chunk Visualizer

Shared

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. Make sure that the Terrain Generator is set inside the component

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.

Normal procedure

Using decimated mesh

  • 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.

Floating Point Origin

Sometimes you will find that you try to move to in a big world and the vegetation starts to flicker. For that purpose, Infinite Lands comes with an implementtion of Floating Point Origin.

Floating Origin

Manages the dynamic world origin, resetting the origin when the reference object moves beyond a specified maximum distance. It triggers the OnOriginMove event, providing the new and previous origin values.

Floating Point

Synchronizes a GameObject with changes in a dynamic world origin managed by a FloatingOrigin component. It adjusts the object’s position when the origin shifts, with optional locking of movement along specific axes (LockX, LockY, LockZ). The OnOffsetAdded event is triggered whenever an offset is applied, allowing external systems to respond to position changes.

Floating Particle

Similar as FloatingPoint but for particle systems. Ensures that particles in a ParticleSystem remain correctly positioned relative to a dynamic world origin managed by a FloatingOrigin component. When the origin shifts, it adjusts particle positions by applying the calculated offset.

Environmental Components

Align With Terrain

Adjusts a GameObject’s position and rotation to align smoothly with terrain or ground surfaces based on the selected alignment mode (None, Ground, Terrain). It integrates with a PointStore to track terrain changes and a FloatingPoint component for offset adjustments. The script ensures smooth transitions to target positions and updates rotation to match terrain normals or world space vectors.

Stay On Terrain

Ensures a GameObject remains above terrain at a specified vertical offset. It listens for terrain updates from a PointStore and adjusts the object’s position if it falls below a defined threshold relative to the ground after a mesh has been generated.

Shared

Mesh Settings

  • Seed: The seed used to randomize the terrain
  • Resolution: The mesh resolution by vertices.
  • Custom Texture Resolution: Do you wish to have a diferent resolution for the textures?
    • Texture Resolution: Define the resolution that the splat maps should be.
  • Mesh Scale: The size of the mesh
  • Mesh Type: Mesh type to be generated
    • Normal Mesh: Every vertex exits
    • Decimated Mesh: It tries to simplify the mesh after creation to reduce the number of vertices while keeping the same look.
  • Core Grid Spacing: Space between vertices to be used with decimated meshesNormal
  • NormalReduceThreshold: Maximum normal difference to discard a normal for decimated meshes.
  • Generation Mode: How should the default feature mode be. Relative to terrain or to the world