I have some problems with updating to

StampMesh function produces voxels that are 3 times smaller then a mesh and in wrong position.

1) StampMesh didn't take WorldScale in to account

In my world voxel size set to 0.1m. I did that by changing following line of code:

public const float VOXEL_TO_UNITY_SCALE = 30f;

I did that, because voxelfarm_Client.worldScale dodn't affect StampMesh. And in previous version mesh for stamp was calculated in Unity side like that:

vertices[floatPosition++] = v1.x * constants.VOXEL_TO_UNITY_SCALE;

But in it was moved to C++ side:

  Algebra::Matrix_scale(&meshTransform, 10 * meshScaleX, 10 * meshScaleY, 10 * -1 * meshScaleZ);

There are hardcoded value of 10. For now i fixed this by setting meshScale to 10/3.

2) After fixes with mesh scale i still have problems with stamp position. It misses for several meters. Didn't manage to find problem yet. 

I have mesh with absolute coordinates of vertices, that i stamp at zero position. Position of a player are close to zero in Unity. That worked fine on previous version.

3) Collider problems

I enable player on OnSceneSwapped event. And there are no collider under the player at that moment.
I often fall under the ground after using StampMesh. 
In previous version there always was consistency between visual terrain mesh and collider. Rarely i could see patches of the terrain disappear. And if i walk there - i would fall. And now there was situations, when i see the ground and it has no collider.

4) Problems with normals. Some in cells and more in patches between cells.
2017_00_06_3.jpg  2017_00_06_2.jpg  2017_00_06_1.jpg
0 0
Thanks for the report, we are looking at this now.
0 0
The world scale affects only the scene in Unity.
We remove the world scale when we do the stamp operation.
Then when cells are baked in Unity we apply the world scale.
To stamp the mesh 3 times smaller simply pass Vector3(0.33,0.33,0.33) as the mesh scale.
For instance if you use a cube of 1m cubic with a scale 0f 0.33 you will get the desired 0.33m cubic in Unity when the world scale is 1.
That means if you set the world scale in Unity to 0.5 you will get 0.33 m cubic * 0.5 afterwards.

OnSceneSwapped callback issue is called offplay which is probably why at start your player is falling. In our example package, in our player controller scripts we disable the player in Awake and enable the player in OnSceneSwapped. Although we can come up with a better solution to make sure the player wont fall again.

Cells disappearing is potentially related to an out of sync issue in the Unity plugin. Usually this was happening when doing excessive stamp operations.

We just fixed an issue with normals and tangents producing black triangles for seams, but as you noticed we still see bad normals. We are currently looking into our codebase to fix it. Hopefully this will be fixed in the next release.

If you still have issues with the stamping with our latest release code, feel free to give us something we can test.

Thanks for the feedback.

0 0
1) Can you tell me exact voxel size in unity? Is it 0.3 or 0.33 or 1/3?
Problems with position was my bug. I changed meshstamp scale to 3 instad of 3.(3).

2) I used the same OnSceneSwapped callback. And it was working before patch. And now i can easily run and fall trough the ground. It seems that collider are generating now in small radius around player, or only for smaller LODs.

We just fixed an issue with normals and tangents

We would need to wait to get the fix?
0 0
1) Each LOD will have its own voxel size.  This can be computed by this formula:


CELL_SIZE is the length of a LOD zero cell. A LOD 1 cell will be double that length and so on. Then to know the length of a single voxel, you would divide the cell length by the number of voxels in a cell, which is the BLOCK_DIMENSION constant.

CELL_SIZE is defined as 30.0 and it is in decimeters.

BLOCK_DIMENSION is 40 since each Voxel Farm cell stores 40x40x40 voxels.

The lowest LOD to appear in a scene is 2 (this is the LOD_0 constant).

When you input these values into the voxel size formula you get (2^2)*30/40 which equals 3 decimeters.

2) We cannot reproduce this at the moment, but we are looking for it.

3) Eric meant there is a fix for bad seam normals in We are also looking to reproduce. I believe you sent us a project before, are you seeing the seam issues in this same project? It could help us reproduce the issue since we still have your project.
0 0
No, i send you slightly modyfied Demo.Unity project. And now i cann't reproduce this bugs in it.
I will try to disable all my modifications. It seems that something i changed are not working in new version.

2) I found, that this code changes voxelfarm_client.focusTarget. And in my case Player doesn't have voxelfarm_ClientSubscriber component.

Is this component supposed to be on Player?

voxelfarm_ClientSubscriber.cs, line 28

        protected void OnEnable()
            client = FindObjectOfType<voxelfarm_client>();
            if (client != null)
                if (clientSceneFocus)
                    client.focusTarget = transform;

3) Still serching...
0 0
Hi Eugeny, your script needs to inherits from voxelfarm_clientSubscriber. the script voxelfarm_clientSubscriber is abstract so you cannot add it as a component directly to an entity.
We included a package that contains examples in the SDK, next to the plugin.
For you last request, with your current project do you still have those issues. Our fix resolve black triangles on seams similar to what you've shown us although the lighting might not be as good as we want so it'll be a little darker but we are working on that and most likely will be in the next release. But as a temporary fix you can add :


at the end of the methods CreateCellRenderMesh() and UpdateCellRenderMesh()


at the end of the methods CreateCellSeamsRenderMesh() and UpdateCellSeamsRenderMesh()
0 0
Hi Eugeny, your script needs to inherits from voxelfarm_clientSubscriber. the script voxelfarm_clientSubscriber is abstract so you cannot add it as a component directly to an entity.

Of course, i did that like you said long ago. And i set voxelfarm_client.focusTarget from my script. But in new version of plugin you override this value in base class. And that broke collider generations for me.

3) I found that this artifacts are visible only in linear color space. I tested in Demo.Unity project. Same artifacts on seams and materals became glossy.
0 0
We dont support linear color space at this moment in Unity plugin.
0 0
Wait, as in you went from supporting it last version and now you don't?

Because it worked last version (linear color space)....

I'm confused!
0 0
We apologize for the mixed signals. Linear Color space *should* be supported, but the issue found by Eugeny in seams is breaking this support.

We are working to correct this issue for the next release.
0 0