Timeline for Unity block chunk generation pattern
Current License: CC BY-SA 4.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 17, 2023 at 17:32 | history | edited | DMGregory♦ | CC BY-SA 4.0 | Adding link |
| Nov 2, 2020 at 16:17 | comment | added | DMGregory♦ | I stated in the answer that the textures are assumed to be in an array, not an atlas. In an array, it's OK to sample outside the 0...1 range, and let the texture sampling hardware wrap your sampling coordinate around for automatic tiling. | |
| Mar 5, 2020 at 14:15 | comment | added | Nick | @DMGregory Sorry, I still can't understand how this should work. Since vertices are now shared between 2 voxels, and for each of these voxels, each vertex is a different "local offset"(eg: Bottom right corner is bottom left corner for the next voxel), how is texture going to be projected correctly? Also I've trouble understanding how global position of vertex in your code(aka position.xyz) directly represents offset on the 2D texture atlas? (If atlas is 256x256 each 16x16 representing 1 block) | |
| Mar 4, 2020 at 18:17 | comment | added | DMGregory♦ | I've included an example. You can of course choose to project your texture coordinates any other way that suits your needs. | |
| Mar 4, 2020 at 18:16 | history | edited | DMGregory♦ | CC BY-SA 4.0 | added 700 characters in body |
| Mar 4, 2020 at 18:03 | comment | added | Nick | @DMGregory I know its a bit late, but only now I've actually had time to start implementing this. Everything's fine so far, I got vertex joining optimization done now, but I am stuck on the ProjectPositionToUV function. Does pair.key.position even matter here? I think I've ideas on how to make this work by adding additional pair.Key.localOffset variable into VertexSignature struct, but if I am doing this wrong I would like to know | |
| Oct 4, 2019 at 11:44 | comment | added | DMGregory♦ | This script builds a mesh consisting of only outside faces. It does it by scanning through the voxel data for the chunk, checking for places where each voxel is exposed to air. Where it finds such a spot, it creates a new pair of triangles to draw there. If two solid voxels sit back-to-back, it generates no triangles between them. It's also set up to share vertices, so where four voxels in a plane meet at a central point, you get one shared vertex instead of four. | |
| Oct 4, 2019 at 11:40 | comment | added | Samuel Fyckes | I don't understand what the script do and how it does it. Is this the script supposed to hide inside faces ? If not what does it do ? If yes, how do you make it happen in general wit that script ? Does it delete inside triangles ? does it somehow merge vertices ? Does it just hide them ? | |
| Aug 7, 2018 at 16:26 | vote | accept | Nick | ||
| Aug 7, 2018 at 15:17 | history | edited | DMGregory♦ | CC BY-SA 4.0 | Adding note on further improvements. |
| Aug 7, 2018 at 15:06 | history | answered | DMGregory♦ | CC BY-SA 4.0 |