Probably, because of shaders. FlatColor shader looks like solid black, when I change to StandardVertexTransp it looks similar to normal, but looks like it have z-order of faces wrong
http://i.imgur.com/oWkxVLC.png
Suggested fixes:
use tex coords instead of color:
//in cycle
var texCoords = new Vector2(cidx / 255f, 0.5f);
uv.Add(texCoords);
uv.Add(texCoords);
uv.Add(texCoords);
uv.Add(texCoords);
...
uv.Add(texCoords);
And use standard shader and a palette png that MagicaVoxel generates when exports obj.
- Fix StandartVertexTransp shader by changing
void vert (inout appdata_full v, out Input o)
to
void vert (inout appdata_full v, out v2f o)
(i.e. do not lose vertex position along the way)
Result is still looks pretty meh, because unshaded
I have also found this shaders that seems to do the trick
Shader "Vertex Color Lit" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
}
SubShader{
Pass{
Lighting On
ColorMaterial AmbientAndDiffuse
SetTexture[_MainTex]{
combine texture * primary DOUBLE
}
}
}
}
Probably, because of shaders. FlatColor shader looks like solid black, when I change to StandardVertexTransp it looks similar to normal, but looks like it have z-order of faces wrong
http://i.imgur.com/oWkxVLC.png
Suggested fixes:
use tex coords instead of color:
And use standard shader and a palette png that MagicaVoxel generates when exports obj.
void vert (inout appdata_full v, out Input o)
to
void vert (inout appdata_full v, out v2f o)
(i.e. do not lose vertex position along the way)
Result is still looks pretty meh, because unshaded
I have also found this shaders that seems to do the trick