Region3 & Terrain Questions

Hello developers! It’s been awhile since I’ve created a topic here but I’ll be brief with my questions.

Context: I’ve begun working on a procedural generation script system that allows me to create terrain based on Perlin Noise and Fractal Brownian Motion; however, if you don’t know what any of that terminology means, you should still be able to help. I managed to complete a chunk-based part generator that loads in terrain based on however I configure it; however, while trying to add in a terrain generation function, I have come across some questions.


  1. What is Resolution in terms of the function: Region3:ExpandToGrid(< int > Resolution) and why is it used twice (once in the Region3:ExpandToGrid function and once in the workspace.Terrain:FillRegion function)?

  2. Will Region3’s of sizes smaller than < Vector3 > (4, 4, 4) be expanded to a 4x4x4 voxel grid? If so, am I able to change this using workspace.Terrain:WriteVoxels and how? (My current theory is to calculate the occurrences of specific materials in a chunk and then generate 4 voxel spaces based on that array)

  3. Is it more or less performance intensive to use workspace.Terrain:WriteVoxels in comparison to looping through an array of Region3s and using workspace.Terrain:FillRegion?


Chunk sizes are 8x8 (X & Z) meaning 4 voxel grids would be needed to fill one chunk on the X & Z axes. The Y axis is theoretically infinite for now. I have yet to complete the Unity tutorial on procedural generation so I haven’t got to height adjustments yet; however, any function I come up with should still work regardless of height modifications.

Thanks again for reading!