hello everyone,
i’m generating via an editor script a simple hard-coded cube, i need the UV to be greater than 1 so that i can have tiled textures without changing the material tiling, everything is working fine except it seems Beast is not generating any UV2 and the lightmap is grey…
UV (not UV2), normals, tangent are working fine…
Am i missing something while generating the mesh?
Here’s the code is use for generating the cube (i stripped the coordinates for lenght reason, if necessary i can post them
)
var brush : GameObject = new GameObject ("Brush");
brush.AddComponent (MeshFilter);
brush.AddComponent (MeshCollider);
brush.AddComponent (MeshRenderer);
var cubeMesh = new Mesh ();
var newVertices : Vector3[] = [ ... ]; // 24 vertices
var newUV : Vector2[] = [ ... ]; // 24 UVs
var newUV2 : Vector2[] = [ ... ]; // 24 UV2s
var newNormals : Vector3[] = [ ... ]; // 24 normals
cubeMesh.vertices = newVertices;
cubeMesh.triangles = [ ... ]; // 12 triangles
cubeMesh.uv = newUV;
cubeMesh.uv2 = newUV2;
cubeMesh.normals = newNormals;
cubeMesh.name = "Brush Cube";
TangentSolver (cubeMesh); // here i calculate tangents
//cubeMesh.Optimize();
//cubeMesh.RecalculateNormals();
//cubeMesh.RecalculateBounds();
brush.GetComponent (MeshFilter).mesh = cubeMesh;
brush.GetComponent ("MeshCollider").mesh = cubeMesh;
brush.renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
brush.renderer.sharedMaterial.mainTexture = tex;
Selection.activeGameObject = brush;
BTW if i don’t input any UV2 at all i get a warning saying Beast requires UV coordinates between (0, 1)
Also, sorry for my bad engligh ![]()
EDIT: i attached a couple of images
this is the cube with a simple red point light
same cube, with baked lighting
here’s the cube lightmap
any help is greatly appreciated ![]()