Skip to content

Optimizations #2

@mirenbhakta

Description

@mirenbhakta

This block in Chunk.cs public void GenerateChunkMesh should be moved into Awake and replaced with List.Clear() calls.

        verts = new List<Vector3>(98304);
        tris = new List<int>(147456);
        uvs = new List<Vector2>(98304);
        coloruvs = new List<Vector2>(98304);

Store chunks in a Dictionary in World.cs. An Array[,,] will not work for infinite terrain.

When chunks are unloaded, make sure to collect Mesh and Material instances that have been created. Either by Destroy() or by reusing them.

In general, carefully consider any new calls for class instances, try to reduce these instances as much as possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions