Getting Started
In this section you will learn the basics of Voxel Renderer.
Last updated
In this section you will learn the basics of Voxel Renderer.
Last updated
Check out the example scenes and scripts that can be found in the Examples folder.
First, create an empty GameObject.
Then, add a VoxelRenderer component to it.
Now, lets create a Voxel Type - an asset (ScriptableObject) that controls how voxels look like. To do this, right click in the Project window and select Create > Voxel Rendering > Voxel Type. Then, add the new voxel type to the Voxel Renderer component.
Now, lets create a material that the Voxel Type will use. Choose the Voxel Lit shader. Then, assign the material in the Voxel Type asset you've created.
Then, set a color you like in all fields (you can copy & paste colors by right clicking). The renderer's setup is now complete.
If you enter play mode now, you will see that the cube is not visible. That's because we need to tell Voxel Renderer where it is first. Lets create a new script.
Add the script to the renderer's GameObject and open it in a code editor.
Replace the default template with the following code. Take a while to study the code and read the comments.
Enter play mode and take a look at your first voxel!
Add more voxels by placing them in a loop (or loops).
Use textures by changing the Surface Color setting in the material.
Generate a collider using VoxelCollider.