Voxel Game With Procedural Mesh How Does Work UVs

IITheRealManII
Wed, 24 Jul 2019 13:03:44 +0000
Rendering

Hello community,

I’m working on a game in voxel like minecraft.

I found what do i need to make the mesh procedurally (procedural mesh component).
I already understand and work with vertex and triangle include triangle order.

My problem start with UVs, i understand that UVs is channel to apply material but i do not understand why they take a Vector2D as parameter and how to fill the array.

For now i try to optimize my mesh so for exemple if i got a big square i only use 4 vertex and 2 triangle but let’s imagine they need 2 material how can i achieve that? Cause in the documentation i found something that said the number of params in the uvs must be the same in the UVs.

Let s use minecraft as exemple you can have a plane surface taking 10x10 blocks but there can be all blocks possible dirt, stone,grass etc… so how this can work with only 4 vertex.

If you don t understand my question cause my english is to bad please let me know.

Wanting for answers thx.

2 posts - 2 participants