forked from oerkki/voxelands
some tweaks to meshgen
This commit is contained in:
parent
d7f8818df0
commit
28c8ca440f
|
@ -644,8 +644,7 @@ void updateFastFaceRow(
|
|||
|
||||
scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
|
||||
{
|
||||
// 4-21ms for MAP_BLOCKSIZE=16
|
||||
// 24-155ms for MAP_BLOCKSIZE=32
|
||||
// 2-12ms for MAP_BLOCKSIZE=16
|
||||
//TimeTaker timer1("makeMapBlockMesh()");
|
||||
|
||||
core::array<FastFace> fastfaces_new;
|
||||
|
@ -671,14 +670,15 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
|
|||
*/
|
||||
|
||||
{
|
||||
// 4-23ms for MAP_BLOCKSIZE=16
|
||||
// 2-12ms for MAP_BLOCKSIZE=16
|
||||
//TimeTaker timer2("updateMesh() collect");
|
||||
|
||||
for (s16 x=0; x<MAP_BLOCKSIZE; x++) {
|
||||
for (s16 y=0; y<MAP_BLOCKSIZE; y++) {
|
||||
for (s16 z=0; z<MAP_BLOCKSIZE; z++) {
|
||||
if (!x) {
|
||||
/*
|
||||
Go through every y,z and get top(y+) faces in rows of x+
|
||||
*/
|
||||
for(s16 y=0; y<MAP_BLOCKSIZE; y++){
|
||||
for(s16 z=0; z<MAP_BLOCKSIZE; z++){
|
||||
updateFastFaceRow(data->m_daynight_ratio, posRelative_f,
|
||||
v3s16(0,y,z), MAP_BLOCKSIZE,
|
||||
v3s16(1,0,0), //dir
|
||||
|
@ -690,13 +690,25 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
|
|||
data->m_vmanip,
|
||||
blockpos_nodes,
|
||||
smooth_lighting);
|
||||
/*
|
||||
Go through every y,z and get back(z+) faces in rows of x+
|
||||
*/
|
||||
updateFastFaceRow(data->m_daynight_ratio, posRelative_f,
|
||||
v3s16(0,y,z), MAP_BLOCKSIZE,
|
||||
v3s16(1,0,0),
|
||||
v3f (1,0,0),
|
||||
v3s16(0,0,1),
|
||||
v3f (0,0,1),
|
||||
fastfaces_new,
|
||||
data->m_temp_mods,
|
||||
data->m_vmanip,
|
||||
blockpos_nodes,
|
||||
smooth_lighting);
|
||||
}
|
||||
}
|
||||
if (!z) {
|
||||
/*
|
||||
Go through every x,y and get right(x+) faces in rows of z+
|
||||
*/
|
||||
for(s16 x=0; x<MAP_BLOCKSIZE; x++){
|
||||
for(s16 y=0; y<MAP_BLOCKSIZE; y++){
|
||||
updateFastFaceRow(data->m_daynight_ratio, posRelative_f,
|
||||
v3s16(x,y,0), MAP_BLOCKSIZE,
|
||||
v3s16(0,0,1),
|
||||
|
@ -710,22 +722,6 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
|
|||
smooth_lighting);
|
||||
}
|
||||
}
|
||||
/*
|
||||
Go through every y,z and get back(z+) faces in rows of x+
|
||||
*/
|
||||
for(s16 z=0; z<MAP_BLOCKSIZE; z++){
|
||||
for(s16 y=0; y<MAP_BLOCKSIZE; y++){
|
||||
updateFastFaceRow(data->m_daynight_ratio, posRelative_f,
|
||||
v3s16(0,y,z), MAP_BLOCKSIZE,
|
||||
v3s16(1,0,0),
|
||||
v3f (1,0,0),
|
||||
v3s16(0,0,1),
|
||||
v3f (0,0,1),
|
||||
fastfaces_new,
|
||||
data->m_temp_mods,
|
||||
data->m_vmanip,
|
||||
blockpos_nodes,
|
||||
smooth_lighting);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue