Client
Unity gRPC client rendering the chunks.
For now, the client is very basic, just requesting a couple of chunks and displaying them as Meshes.
The low-level parts are hovewer ready for building more advanced usage.
Getting started
The client is in src/TerraProc.Client, it is a standard Unity project dir. You can open in up in Unity editor and
play around with it or build a runnable version.
The project uses several packages.
Some packages are included from the Unity package manager directly.
For some, you need NuGetForUnity - click Restore Packages.
Notably, YetAnotherHttpHandler is used for HTTP/2 (and thus sensible gRPC)
support.
The assemblies for the protobuf generated classes are directly included in the repo for ease of setup (in Assets/Plugins/),
no need to do anything about them. When the TerraProc.Contracts project is rebuilt, the protobuf classes are regenerated
and automatically copied here.
Architecture overview
The project uses the Universal Rendering Pipeline.
All sources are in Assets/Scripts/.
gRPC client
The ChunkServiceClient class is a simple gRPC client for the chunk service.
You can easily use it for your custom use case of the service.
Renderer
A built-in chunk renderer is provided at ChunkRenderer, taking the chunk data and
returning a Mesh.
Usage
Example usage is in the ChunkTest MonoBehaviour. It is configurable with the server
parameters to use directly in the editor.
Note that it uses the cleartext h2c HTTP endpoint by default as I was not able to get it work correctly with the ASP.NET self-signed dev certs.
TODO
- make docfx generate API reference for the client project too (skipped now because needs the packages + unity installed - extra work for CI)