-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does this also work in multiplayer? #1
Comments
I am currently working on multiplayer support as a matter if fact so yes. I
needed the multiplayer package since I needed the INetworkSerializable
interface from there since for some reason unity only has their
serialization system in the multiplayer package.
…On Sun, Mar 31, 2024, 5:49 a.m. cooler ***@***.***> wrote:
I dont see a reason why you have added networking to it as well?
—
Reply to this email directly, view it on GitHub
<#1>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIJFIDTMRX6OUUQEETCQZKLY27LYZAVCNFSM6AAAAABFQI6FEWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTMOBXGQ3TSNY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Btw, how does the seaming between chunks work can you show me which script handles that? |
Since I use surface nets, the mesh vertices generated by the mesher might clip outside the boundary of a single chunk, so I just clip the vertices near chunk boundaries to the actual chunk boundaries. The script that handles this is the VertexJob file. I also extend the mesh downwards (towards the terrain) using skirts, so that you can't see the sky sphere or sky box within small gaps between chunks/ VoxelTerrainGenerator/Runtime/Mesher/VertexJob.cs Lines 155 to 179 in 9813539
VoxelTerrainGenerator/Runtime/Mesher/QuadJob.cs Lines 155 to 158 in 9813539
VoxelTerrainGenerator/Runtime/Mesher/QuadJob.cs Lines 139 to 142 in 9813539
Normally for surface nets meshes you would use something like a full octree to be able to generate "seam" meshes that make the transition between chunks more smooth, but for now this method not only is very easy to implement but also doesn't introduce inter-chunk dependencies. I will improve it in the long run though because the seams are pretty noticeable in some cases. On the topic of skirt generation, I should note that I had an idea for generating better skirts by first creating an SDF of the voxel terrain and then only generating the skirt vertices when getting a certain distance away from the isosurface. At the moment it is checking the density value instead, which fluctuates a lot and isn't really representative of the closest distance to the surface since the domain can be warped in many ways in the compute shader. |
As for multiplayer, I already have a crude implementation working (being able to load the same world and rendering props on all players) but nothing major so far. Next steps would be to send world information (seed value and parameters) to all clients and handle synchronized voxel/dynamic edits |
So you just offset the vertices at the edge a bit further without knowing the data of the neighbour chunks right? |
Yes. It works most of the times but in some cases it creates "planar" surfaces with normals that differ too much from the actual surface, causing them to look very weird. |
I dont see a reason why you have added networking to it as well?
The text was updated successfully, but these errors were encountered: