![]() This will spawn cubes where the height is more than 10, and sphere where it's below -10. You can now extend the graph to look like this: Then, in your voxel graph details (click on the background of the graph) set the output config to the one we just created: This will give us slightly more interesting hills:Īdd two float outputs to it, named CubeDensity and SphereDensity: Our goal here will be to separate the spawn areas of spheres and cubes.Īnd set your voxel world generator to be this graph: Try editing your map using the voxel editor tools, and see the spawners update automatically:ĭuplicate our mesh spawner, and set its mesh to be a sphere instead.Īdd it to our spawner config, and set their spawn distances to 256: Your spawner config should now look like this: This category holds more advanced properties: The voxel invoker needs to have the Use For Events property toggled. The generation distance is how far spawners will be generated from Voxel Invokers. For lower density spawners like trees, a larger chunk size can give the same result way faster.For dense spawners like grass that is only spawned near the player, it's best to use a chunk size of 32.In practice, this lower resolution is not noticeable.Īnother performance concern is the time taken to detect chunks near the player: if the chunk size is 32, and the generation distance 16384, 512x512x512 = 134217728 potential chunks need to be considered, which will be too long to be real time. ![]() The mesh is always 32x32x32: if the chunk size is higher than 32, the mesh will have a lower resolution than the actual geometry. This configures their size.Īdditionally, for ray spawners, this also configures the resolution of the mesh used for spawning. We can use a constant value, a world generator output or some material channel.Ī world generator output can be used to drive the density based on some noise.Ī material channel can be used to drive the density by manually painted data - eg, you can paint the material UVs and use that as density. This is the spawner asset to use - here our mesh spawner Spawners is where all the spawners are stored. Outputs can be used to configure the density, materials and height of the spawners. Word Generator Outputs is to configure the outputs your world generator will have. Flat will make them top to botton, Sphere will make them go towards the center of the voxel world. World Type configures how the rays to find spawn positions will be traced. Usually you want a lot more than that: that's where the Spawner Config comes into play.Ī Spawner Config is the link between the voxel world, the world generator and the spawners. You can also setup some restrictions, such as max angle with the world up (world up is set in the world generator, to allow spherical worlds to be handled differently than flat ones).Ī mesh spawner configures how to spawn a single mesh. Here, you can configure how to spawn your mesh: its scale, rotation and position relative to the spawn positon. Here, we want our cubes to collide with the player, so we'll leave our collision to BlockAll. ![]() Note that the collisions settings are separate from the actor collision settings: for example you could want to have non-colliding grass that still collides with the voxel world when dug under. Instance Settings are used to configure the Hierarchical Instanced Mesh where the mesh will be rendered. Spawning an actor allows to have physics: when you dig under a tree, it will fall. The Actor Settings section is to configure the actor that will be spawned when the instance is floating. Here, we want to spawn a cube roughly every 5 voxels, so let's set that to 5: See Sending data to the material below.ĭistance between instances in voxel is the average distance we want between our foliage instances. Instance Random can be used to send custom parameters to the foliage material. Open it, and set the Mesh property to the mesh you want to spawn: This allows to make a tree properly fall when dug under for instance. Optionally, when digging, you can check for floating foliage instances nearby, and replace them with full actors. First, we need to create a mesh spawner: a spawner stores information about what to spawn, how to spawn it and where it can be spawned.Ī mesh spawner uses a Hierarchical Instanced Mesh to render the meshes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |