Success to blend 4 texture
Need improuve for angle.
This commit is contained in:
parent
b9a2b87fe9
commit
664eb5872a
8 changed files with 186 additions and 105 deletions
|
|
@ -6,18 +6,22 @@ namespace LandblockExtraction.LandBlockExtractor {
|
|||
public Vector4[] color { get; set; }
|
||||
public Vector4[] farcolor { get; set; }
|
||||
public Vector2[] texturecoord { get; set; }
|
||||
public Vector4[] terraintype { get; set; }
|
||||
public float[] realtype { get; set; }
|
||||
|
||||
public VerticesStruct(int blockSize) {
|
||||
position = new Vector3[blockSize * blockSize];
|
||||
color = new Vector4[blockSize * blockSize];
|
||||
farcolor = new Vector4[blockSize * blockSize];
|
||||
texturecoord = new Vector2[blockSize * blockSize];
|
||||
texturecoord = new Vector2[blockSize * blockSize];
|
||||
terraintype = new Vector4[blockSize * blockSize];
|
||||
realtype = new float[blockSize * blockSize];
|
||||
}
|
||||
|
||||
public float[] Vertices() {
|
||||
int length = position.Length;
|
||||
float[] vertices = new float[length * 13]; // 3 pour position, 4 pour color, et 4 pour farcolor
|
||||
for (int i = 0, vi = 0; i < length; i++, vi += 13) {
|
||||
float[] vertices = new float[length * 18]; // 3 pour position, 4 pour color, et 4 pour farcolor
|
||||
for (int i = 0, vi = 0; i < length; i++, vi += 18) {
|
||||
vertices[vi] = position[i].X;
|
||||
vertices[vi + 1] = position[i].Y;
|
||||
vertices[vi + 2] = position[i].Z;
|
||||
|
|
@ -31,6 +35,11 @@ namespace LandblockExtraction.LandBlockExtractor {
|
|||
vertices[vi + 10] = farcolor[i].W;
|
||||
vertices[vi + 11] = texturecoord[i].X;
|
||||
vertices[vi + 12] = texturecoord[i].Y;
|
||||
vertices[vi + 13] = terraintype[i].X;
|
||||
vertices[vi + 14] = terraintype[i].Y;
|
||||
vertices[vi + 15] = terraintype[i].Z;
|
||||
vertices[vi + 16] = terraintype[i].W;
|
||||
vertices[vi + 17] = realtype[i];
|
||||
}
|
||||
return vertices;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue